bugDotGNU Portable.NET - Bugs: bug #9539, FileStream constructor throws...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #9539: FileStream constructor throws incorrect exception

Submitted by:  Marcus Urban <mathpup>
Submitted on:  Sat 03 Jul 2004 06:14:32 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Thong Nguyen <tum>
Open/Closed: Closed

Mon 23 Aug 2004 12:44:09 PM UTC, comment #2:

fixed in cvs

Thong Nguyen <tum>
Project MemberIn charge of this item.
Sun 18 Jul 2004 02:13:27 PM UTC, comment #1:

FileStream is not the culprit here from what I can tell. It handles the ENOENT errno and deals with the directory and file not found exceptions. I've only been able to trace back as far as pnet/support/file.c:ILSysIOOpenFile, both functions, the first seams to only set EACCES, and the second ENOENT (perhaps someone can explain to me why there are two..)

Deryk Robosson <drobosson>
Project Member
Sat 03 Jul 2004 06:14:32 AM UTC, original submission:

According to the MSDN docs and testing with Rotor, when the FileStream constructor that takes a filename and mode is used, and the file is not found, a FileNotFoundException should be thrown. Pnet throws the more generic IOException ("operation not permitted"). IOException does not include information about the file that caused the error, so catching IOException does not permit a very descriptive error message.

The test case I'm attaching aborts with this error on Rotor:

Unhandled Exception: System.IO.FileNotFoundException: Could not find file "/home/marcus/alpha/test-cases/DoesNotExist".
File name: "/home/marcus/alpha/test-cases/DoesNotExist"
at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
at Testing.Main()

Marcus Urban <mathpup>

 

Attached Files
file #1461:  filestream.cs added by mathpup (175B - text/x-csharp - Test case)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 4 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 25 Aug 2004 06:32:13 AM UTCtumOpen/ClosedOpen=>Closed
Mon 23 Aug 2004 12:44:09 PM UTCtumAssigned toNone=>tum
Mon 23 Aug 2004 12:44:08 PM UTCtumStatusNone=>Fixed
Sat 03 Jul 2004 06:14:32 AM UTCmathpupAttached File-=>Added filestream.cs, #1454

Back to the top


Powered by Savane 3.1-cleanup1