FileStream with DeleteOnClose File option
You need to use |
instead of &
.
These are binary flags, and when you say &
, you effectively mask them all away, resulting in no options at all.
Use FileOptions.DeleteOnClose | FILE_FLAG_NO_BUFFERING
the &
cancels them out.
FILE_FLAG_NO_BUFFERING & FileOptions.DeleteOnClose
returns FileOptions.None