bug-gnustep
[Top][All Lists]
Advanced

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

[bug #35671] Wrong error from -[NSFileManager createDirectoryAtPath:...]


From: Graham Lee
Subject: [bug #35671] Wrong error from -[NSFileManager createDirectoryAtPath:...]
Date: Mon, 29 Apr 2013 15:51:36 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/536.29.13 (KHTML, like Gecko) Version/6.0.4 Safari/536.29.13

Follow-up Comment #1, bug #35671 (project gnustep):

I don't know how precise compatibility with Mac OS X/Cocoa should be for this
bug, but the behaviour proposed in the patch doesn't match it:

'Wrong error Error Domain=NSCocoaErrorDomain Code=516 "The file “foobar”
couldn’t be saved in the folder “tmp” because a file with the same name
already exists." UserInfo=0x7f85d940ab80 {NSFilePath=/tmp/foobar,
NSUnderlyingError=0x7f85d940a9d0 "The operation couldn’t be completed. File
exists"}'

but error code 516 is not EEXIST and the error is in the Cocoa error domain.
The _underlying_ error is in NSPOSIXErrorDomain and has code 17 (EEXIST). The
matching Foundation error (from Foundation/FoundationErrors.h) is this:

    NSFileWriteFileExistsError NS_ENUM_AVAILABLE(10_7, 5_0) = 516,          //
Write error (file exists)

which is what NSFileManager returns in Foundation. I think it'd be reasonable
for GNUstep-base to follow that example.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?35671>

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




reply via email to

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