August 1999
Intermediate to advanced
1488 pages
72h 53m
English
file.flush()
The flush() method of the File object is used to write buffered information to a file. This information is placed in a buffer when the write(), writeln(), and writeByte() methods are used. Note that this is not the same as the top-level flush function.
Listing 8.77 opens a file for reading and another file for writing. If the file for reading exists, a string is written to the other file. The flush() method is used to write the actual buffer of information to the file.
<SERVER> // Open a log file var myLog = new File("/data/logs/today.log"); var mySummary = new File("/data/logs/summary.log"); myLog.open("r"); mySummary.open("w"); // See if the ... |
Read now
Unlock full access