write, writec, pretty_write, pretty_writec — write an expression to a file.
write (file, s_exp...) writec (file, s_exp...) pretty_write (file, s_exp...) pretty_writec (file, s_exp...)
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>
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.