Io/FileWriteBug

edit
revisions

what's new
search
help

kiwi


Here's an example of the bug (which I consider to be confusing behavior, not a technical bug). Example taken with 2005-02-02.

 
$ cat test.txt
blah1
blah2
blah3
$ io
Io> f := File setPath("test.txt") openForUpdating write("blahX");
Io>
$ cat test.txt
blahX
blah2
blah3
 

Note the first line of test.txt after writing. Most users wouldn't expect the file to be updated in place.

To me, the term "openForUpdating" makes this clear. Perhaps we require a "openForWrite" method that does what most users expect? People in the IRCChannel were suggesting that the software do ftruncate() or something along those lines, but fopen(file, "w") should do the job fine.

last modified on September 27, 2005, at 03:35 PM

© type-z.org and its contributing authors, 2001-2004.
Content is licensed under a Creative Commons License.