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...)
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-2006 by Cogent Real-Time Systems, Inc. All rights reserved.