c# - StreamWriter not writing out the last few characters to a file -


we having issue 1 server , it's utilization of streamwriter class. has experienced similar issue below? if so, solution fix issue?

  using( streamwriter logwriter = file.createtext( logfilename ) )   {     (int = 0; < 500; i++)       logwriter.writeline( "process completed successfully." );   }  

when writing out file following output generated:

  process completed successfully.   ...  (497 more lines)   process completed successfully.   process completed s 

tried adding logwriter.flush() before close without help. more lines of text write out more data loss occurs.

cannot reproduce this.

under normal conditions, should not , not fail.

  • is actual code fails ? text "process completed" suggests it's extract.
  • any threading involved?
  • network drive or local?
  • etc.

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -