Exception: Filestream will not open win32 devices.... don't use \ "\\\.\\\" in the path

  • Thread starter Thread starter Patrick Sannes
  • Start date Start date
P

Patrick Sannes

Hi,

At this moment I have one large sourcecode file and want to seperate it into
multiple files. When I do so, the app crash after he created 6389 (156794880
bytes total) source files with the error:
Filestrem will not open Win32 devices such as disk partitions and tape
drives. Don't use \ \\\.\\\ in the path.
After I put in an exception handler and an breakpoint in it, i discovered
that the filename was a correct one. (just like the other 6389 files)

(I use the .net visual studio 2005 beta refresh.) Could this be a bug? Or am
I missing something.

Patrick
 
For the record. At this moment I use only the Streamwriter without a
FileStream, becouse when using the FileStream, i randomly was missing lines
in the files.

also buggy?
 
To be really clear...

The missing line code
Filestream FS = new FileStream(filename,FileMode.CreateNew);
StreamWriter SW = new StreamWriter(FS);

This error occurs on:
StreamWriter SW = new StreamWriter(filename);

Sorry for the incorrect postings.... (worked a bit long on this.)
 
Patrick Sannes said:
To be really clear...

The missing line code
Filestream FS = new FileStream(filename,FileMode.CreateNew);
StreamWriter SW = new StreamWriter(FS);

This error occurs on:
StreamWriter SW = new StreamWriter(filename);

Sorry for the incorrect postings.... (worked a bit long on this.)

What is the value of filename at that point in time? I'd assume its a Win32
device name, but without knowing the value of filename, I couldn't say.
 
Daniel O'Connell said:
What is the value of filename at that point in time? I'd assume its a
Win32 device name, but without knowing the value of filename, I couldn't
say.
The filename was C:\Natural\Splitsources\CON.Program
the value of filename was "C:\\Natural\\Splitsources\\CON.Program
 
Back
Top