views:

294

answers:

1

I am using TinyScheme (actually Script-Fu in GIMP), and cannot find a good way to open a file and append a line of text to it.

I am trying to log some info to the file for debugging, and transcript-on doesn't seem to be implemented...

Right now I am scraping along by reading the entire file (one character at a time!), concatenating that into a string, concatenating my text to the end of that, then writing it all out to the file again.

There must be a better way!

+2  A: 

It's going to be something like

(open-file "myfile" (file-options append))

You want to look up the file-options function.

Update

Here's the guile version:

(open-file "myfilename.dat" "a")
Charlie Martin
hmm... that gets me to the right part of the docs at least (:GIMP doesn't recognize file-options, alas...
Try the open-file flag. Unfortunately, it's very hard to axiomatize this stuff, so Scheme doesn't specify it at all.
Charlie Martin