flush
flush — flushes any pending output on a file or string.
flush (file)
fileA 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.");tGamma>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.");tGamma>flush(fp);tGamma>fp=open("myflushfile.dat","r",nil);#<File:"myflushfile.dat">Gamma>read_line(fp);"\"I am written.\""Gamma>