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

Submitter:  Marcus Urban <mathpup>
Submitted:  Sat 03 Jul 2004 06:14:32 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  tum
Open/Closed:  Closed

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

fixed in cvs

Thong Nguyen <tum>
Group Member
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>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-08-25 tum Open/ClosedOpen Closed
2004-08-23 tum Assigned toNone tum
2004-08-23 tum StatusNone Fixed
2004-07-03 mathpup Attached File- Added filestream.cs, #1454

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code