Daniel wrote:
System.IO.StreamWriter Close or Flush method to shut down the computer in
such a way that just part of the file is written?
I don't know if I understood this...
Do you want to make sure that your file is being written to disk, even
if the computer is shut down before you called Close?
Use Flush - it will write everything in the internal buffer to disk.
You can try it yourself without shutting down the computer - just don't
use Flush but immediately exit the Application after you called Write a
few times - the file will most certainly be incomplete...
or an empty file is
written?
That depends on how often you use Flush. If you use it after each byte
you write, all will be on the disk but this has a very bad performance.
Best thing may be to use Flush manually after each important block of
data you wrote and before Close.
--
Pascal Schmitt