dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] [bugs #10485] File.Delete(string) throws an exception


From: Rhys Weatherley
Subject: [Pnet-developers] [bugs #10485] File.Delete(string) throws an exception when the file does not exist
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826

This mail is an automated notification from the bugs tracker
 of the project: DotGNU Portable.NET.

/**************************************************************************/
[bugs #10485] Latest Modifications:

Changes by: 
                Rhys Weatherley <address@hidden>
'Date: 
                Fri 09/24/2004 at 02:52 (GMT)

            What     | Removed                   | Added
---------------------------------------------------------------------------
          Resolution | None                      | Fixed
              Status | Open                      | Closed


------------------ Additional Follow-up Comments ----------------------------
Fix committed to CVS - 24 Sep 2004.  The "gen_errno.sh"
script will now use the output of "gcc -dD -E" to find the
error codes, which should handle definitions in multiple
/usr/include header files.  If the compiler does not support
"-dD", it will fall back to the current "assume that they
are all in one file" method.






/**************************************************************************/
[bugs #10485] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=10485>
Project: DotGNU Portable.NET
Submitted by: Marcus Urban
On: Fri 09/24/2004 at 00:38

Category:  None
Severity:  5 - Average
Item Group:  None
Resolution:  Fixed
Privacy:  Public
Assigned to:  None
Status:  Closed


Summary:  File.Delete(string) throws an exception when the file does not exist

Original Submission:  File.Delete(string) throws an exception when the file 
does not exist. I think that it has something to do with the mapping of error 
codes.

File.Delete() invokes a helper method, which returns an error code. If the 
error code is that the file does not exist, everything is okay. Otherwise, an 
exception is thrown.

The problem is that eventually ILDelete() is called, which first tries the 
rmdir() function and then tries unlink(). If the file does not exist unlink() 
returns ENOENT, which is the integer 2 on my system. However, 
ILSysIOConvertErrno() converts this value to 1 (EPERM). So eventually 
File.Delete() receives an error code corresponding to EPERM, when it should 
instead receive ENOENT.


Follow-up Comments
------------------


-------------------------------------------------------
Date: Fri 09/24/2004 at 02:52       By: Rhys Weatherley <rweather>
Fix committed to CVS - 24 Sep 2004.  The "gen_errno.sh"
script will now use the output of "gcc -dD -E" to find the
error codes, which should handle definitions in multiple
/usr/include header files.  If the compiler does not support
"-dD", it will fall back to the current "assume that they
are all in one file" method.






File Attachments
-------------------

-------------------------------------------------------
Date: Fri 09/24/2004 at 00:38  Name: test-delete.cs  Size: 114B   By: mathpup
Test case
http://savannah.gnu.org/bugs/download.php?item_id=10485&amp;item_file_id=1700






For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=10485>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]