> Hi,
> I'm writing a script-fu GIMP plugin and I need to be able to write some
> decimal values to a file during the execution of the script.  I've seen
> some
> people suggesting that use of fprintf, etc., but can't figure out how to
> get
> this to work.  Can someone please provide some guidance?

If you are using GIMP 2.3.14 or later, the following code should
demonstrate how to write to a file:

(define outport (open-output-file "samplefile.txt"))
(display  "Hello" outport)
(newline outport)
(display "World" outport)
(close-output-port outport)

If you are using a stable version (2.2.x) of the GIMP, then you will need
to use SIOD's 'fopen', 'fwrite', and 'fclose' functions.

(define outfile (fopen "samplefile.txt" "w"))
(fwrite "Hello" outfile)
(fwrite "\n" outfile)
(fwrite "World" outfile)
(fclose outfile)

Gimp-user mailing list

Reply via email to