Tclvfs: why no r+ file open mode? 
Author Message
 Tclvfs: why no r+ file open mode?

To learn tclvfs, I am writing a memchan-based memory-only vfs.
I noticed that when I do "open filename r+" then my fs proc gets
called with a mode of "a+".

A rather quick look thru the Tcl 8.4.11 source and vfs.c shows
that while Tcl correctly translates the mode string to posix
open flags (O_RDONLY, etc), vfs.c does not do the correct
reverse translation.  Why?  ...or should I ask this on another list?



Mon, 28 Apr 2008 01:51:48 GMT  
 Tclvfs: why no r+ file open mode?
It's a bug.  See
http://sourceforge.net/tracker/index.php?func=detail&aid=990921&group...
Quote:

> To learn tclvfs, I am writing a memchan-based memory-only vfs.
> I noticed that when I do "open filename r+" then my fs proc gets
> called with a mode of "a+".

> A rather quick look thru the Tcl 8.4.11 source and vfs.c shows
> that while Tcl correctly translates the mode string to posix
> open flags (O_RDONLY, etc), vfs.c does not do the correct
> reverse translation.  Why?  ...or should I ask this on another list?



Mon, 28 Apr 2008 04:51:59 GMT  
 Tclvfs: why no r+ file open mode?

Quote:

> It's a bug.  See
> http://sourceforge.net/tracker/index.php?func=detail&aid=990921&group...


>>To learn tclvfs, I am writing a memchan-based memory-only vfs.
>>I noticed that when I do "open filename r+" then my fs proc gets
>>called with a mode of "a+".

>>A rather quick look thru the Tcl 8.4.11 source and vfs.c shows
>>that while Tcl correctly translates the mode string to posix
>>open flags (O_RDONLY, etc), vfs.c does not do the correct
>>reverse translation.  Why?  ...or should I ask this on another list?

Thx.  I should have thought to check the bug db myself


Mon, 28 Apr 2008 05:24:04 GMT  
 Tclvfs: why no r+ file open mode?
Hopefully, now that you've shown that this bug has tripped up multiple
people, it will provide impetus to GET IT FIXED.
Quote:


> > It's a bug.  See
> > http://sourceforge.net/tracker/index.php?func=detail&aid=990921&group...


> >>To learn tclvfs, I am writing a memchan-based memory-only vfs.
> >>I noticed that when I do "open filename r+" then my fs proc gets
> >>called with a mode of "a+".

> >>A rather quick look thru the Tcl 8.4.11 source and vfs.c shows
> >>that while Tcl correctly translates the mode string to posix
> >>open flags (O_RDONLY, etc), vfs.c does not do the correct
> >>reverse translation.  Why?  ...or should I ask this on another list?

> Thx.  I should have thought to check the bug db myself



Tue, 29 Apr 2008 04:09:46 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Different behaviour of open command while opening with w or r+ mode

2. Tclvfs [open] mode question

3. pipeline with [open r+] problem

4. set fp [open "|program" r+]

5. open |tcl r+ (how?)

6. CW2003 File Open Modes

7. Open file in exclusive mode (CW2003)

8. How to select file open mode

9. Open File with Exclusive Access Mode Question

10. Open a file in ASCII mode

11. How to open a QSAM file in append mode

12. open a file in binary mode?

 

 
Powered by phpBB® Forum Software