On Friday 02 July 2004 10:57, John R. Hogerhuis wrote:
> The GForth manual is very good, but it is not obvious to me how you open
> a file for 'append'? I see you can specify r/o, r/w, w/o, but what about
> append?
Hm, the Forth standard does not specify append. I append to files by opening
them r/w, and then seeking to the end (i.e. fd file-size throw fd
reposition-file throw). A change to Gforth would be trivial, just add the
necessary C modes to fileattr in engine/main.c ("ab", "ab", "a+b", "a+b"),
and define the constants in kernel/files.fs (6 for w/a, 8 for rw/a).
--
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://www.jwdt.com/~paysan/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]