|
Ernest,
> I am looking for the correct code
> to open a file for binary reading and
> writing. According to the comments,
> the following should work. It doesn't.
(Slight detour) You can make it a bit tidier by replacing the first line
with
w := (FileStream readWrite: 'bin.dat') beBinary.
which, IMHO, is a bit easier to read and does the same thing. It doesn't
help with your error though!. You can get round that by ensuring the file is
flushed before it is reset
w
flush;
reset.
Whether this is a bug or just a side effect of the way Dolphin handles
ReadWriteStream (and subclasses) I can't decide. I think it's the latter and
that you just have to be a bit careful when changing the mode of a stream
like this so make sure both the read and write pointers are updated.
Ian
|