473,320 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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
Nov 16 '05 #1
5 8938
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?

"Patrick Sannes" <pa*****@nospam.penan.nospam.nl> schreef in bericht
news:41**********************@dreader2.news.tiscal i.nl...
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

Nov 16 '05 #2
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" <pa*****@nospam.penan.nospam.nl> schreef in bericht
news:41**********************@dreader2.news.tiscal i.nl...
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?

"Patrick Sannes" <pa*****@nospam.penan.nospam.nl> schreef in bericht
news:41**********************@dreader2.news.tiscal i.nl...
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


Nov 16 '05 #3

"Patrick Sannes" <pa*****@nospam.penan.nospam.nl> wrote in message
news:41**********************@dreader2.news.tiscal i.nl...
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.
Nov 16 '05 #4

"Daniel O'Connell [C# MVP]" <onyxkirx@--NOSPAM--comcast.net> schreef in
bericht news:uT**************@TK2MSFTNGP11.phx.gbl...

"Patrick Sannes" <pa*****@nospam.penan.nospam.nl> wrote in message
news:41**********************@dreader2.news.tiscal i.nl...
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.

The filename was C:\Natural\Splitsources\CON.Program
the value of filename was "C:\\Natural\\Splitsources\\CON.Program
Nov 16 '05 #5
"CON" is a reserved windows device name, you cannot use this within a
filename.

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
"Patrick Sannes" <pa*****@nospam.penan.nospam.nl> schrieb im Newsbeitrag
news:41**********************@dreader2.news.tiscal i.nl...

"Daniel O'Connell [C# MVP]" <onyxkirx@--NOSPAM--comcast.net> schreef in
bericht news:uT**************@TK2MSFTNGP11.phx.gbl...

"Patrick Sannes" <pa*****@nospam.penan.nospam.nl> wrote in message
news:41**********************@dreader2.news.tiscal i.nl...
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.

The filename was C:\Natural\Splitsources\CON.Program
the value of filename was "C:\\Natural\\Splitsources\\CON.Program

Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: greatbooksclassics | last post by:
Open Source DRM? What does everyone think about it? Will Open Source DRM ever catch up to MS DRM? Will DRM ever be integrated into common LAMP applications?...
10
by: Alpha | last post by:
I use FolderBrowserDlg for user to select a folder path then store it in the sql table. I then retrieve it to concatenate in a sqlcommand text to retrive files from that directory but it won't...
42
by: usenet | last post by:
I'm still confused about this and I can't find anywhere that explains it properly. I have the MS book "Access 2003" in front of me and I'm reading Part 5 about VB and so on. It's telling me...
6
by: kelvlam | last post by:
Hello, I'm a new begininer with JavaScript. I'm trying to figure out which is the best approach, and to understand the differences between them. I have a <Aelement that's suppose to either...
1
by: scolivas | last post by:
I want to make a button that will open a specific file folder that contains some crystal reports. I don't want to pick a report ...just want to "lead the user to the folder" with just a click... ...
10
by: Dave griffiths | last post by:
Hi all Using VB2005 on Vista with a Norwegian locale setup. The test program has 3 textboxes the sum held in txt3. Using the code below, txt2 conversion causes an error when it is left empty....
1
by: manchin2 | last post by:
Hi, Can anybody please provide the information about "&quot" and its use, if possible please provide an example. ...
4
by: fran7 | last post by:
Hi, from help in the javascript forum I found the error in some code but need help. This bit of code works perfectly, trouble is I am writing it to a javascript function so the height needs to be in...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.