D
Dave Weeden
Hi,
I've run across what I beleive to be a bug in the framework or the
underlying Win32 subsystem. I've included the code that triggers the problem
as well as its diagnostic output.
Note that changing 'con.txt' to 'coon.txt' or something else rectifies the
problem so its something about that particular three letter combination.
Any ideas,
Dave
CODE:
-------
try
{
using (FileStream stream = new FileStream("C:\\con.txt", FileMode.Create))
{
// do work
}
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine(e.Message);
System.Diagnostics.Debug.WriteLine(e.StackTrace);
}
OUTPUT:
----------
FileStream will not open Win32 devices such as disk partitions and tape
drives. Avoid use of "\\.\" in the path.
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize,
FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean
bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
I've run across what I beleive to be a bug in the framework or the
underlying Win32 subsystem. I've included the code that triggers the problem
as well as its diagnostic output.
Note that changing 'con.txt' to 'coon.txt' or something else rectifies the
problem so its something about that particular three letter combination.
Any ideas,
Dave
CODE:
-------
try
{
using (FileStream stream = new FileStream("C:\\con.txt", FileMode.Create))
{
// do work
}
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine(e.Message);
System.Diagnostics.Debug.WriteLine(e.StackTrace);
}
OUTPUT:
----------
FileStream will not open Win32 devices such as disk partitions and tape
drives. Avoid use of "\\.\" in the path.
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize,
FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean
bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)