flush (file)
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.
This function flushes any pending output on the file or string. This has the effect of printing output on the screen or updating a file on disk in the case of a file. flush has no effect on strings. flush is called automatically by close.
Gamma> fp=open("myflushfile.dat","w",nil); #<File:"myflushfile.dat"> Gamma> write(fp, "I am written."); t Gamma> fp=open("myflushfile.dat","r",nil); #<File:"myflushfile.dat"> Gamma> read_line(fp); "Unexpected end of file" Gamma> fp=open("myflushfile.dat","w",nil); #<File:"myflushfile.dat"> Gamma> write(fp, "I am written."); t Gamma> flush(fp); t Gamma> fp=open("myflushfile.dat","r",nil); #<File:"myflushfile.dat"> Gamma> read_line(fp); "\"I am written.\"" Gamma>
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.