A file pointer to a previously opened file. This may be either a file in the file system, or a string opened for read and write.
Any Gamma or Lisp expression.
Writes the given expressions to the file using the same format as print. See print for more information.
writec produces the same format as princ; pretty_write produces the same format as pretty_print; and pretty_writec produces the same format as pretty_printc. Any contents written to the file before it was opened will be deleted when any of these write functions are used.
Gamma> fw = open("mywritefile.dat", "w");
#<File:"mywritefile.dat">
Gamma> write(fw,"This is on \n one line.");
t
Gamma> writec(fw,"This finishes on \n another line.");
t
Gamma> close(fw);
t
Gamma> fr = open("mywritefile.dat", "r", nil);
#<File:"mywritefile.dat">
Gamma> read_line(fr);
"\"This is on \n one line.\"This finishes on "
Gamma> read_line(fr);
" another line."
Gamma>
See the GTK: Preparing Plots section of the Log Functions chapter in the Cogent Tools Demo and Tutorials book for an example of this function used in context.