So therefore here is an hint for C# developers:
Just use the
FileOptions.DeleteOnClosevalue as parameter of the
FileStreamconstructor, this will keep you handles clean.
Heres comes an excample:
using (FileStream fStream = new FileStream(Path.GetTempFileName(), FileMode.Create, FileAccess.Write, FileShare.None, 4096, FileOptions.DeleteOnClose))) { // do work }
Good luck.
No comments:
Post a Comment