Re: NSFileManager's errors in 10.5, where are they documented?
Re: NSFileManager's errors in 10.5, where are they documented?
- Subject: Re: NSFileManager's errors in 10.5, where are they documented?
- From: Jonathan Dann <email@hidden>
- Date: Wed, 28 May 2008 18:45:54 +0100
Thanks Jens and Ali, I appreciate your time.
On 26 May 2008, at 20:15, Ali Ozer wrote:
In general Cocoa classes, including NSFileManager, return errors
just in the domain NSCocoaErrorDomain. So all the possible errors
should be listed in FoundationErrors.h.
However, there may of course be underlying errors; these are often
in the POSIX domain. Note that you can never count on the presence
of underlying errors, and they may change between releases.
I'd forgotten about underlying errors, thanks!
Ali
On May 26, 2008, at 11:04 , Jens Alfke wrote:
NSFileManager is probably going to return errors in
NSPOSIXErrorDomain, since it mostly makes Unix system calls. Those
are defined in <sys/errno.h>.
Some methods might use CarbonCore FileManager calls, which would
return errors in NSOSStatusErrorDomain. Those are defined in
<MacErrors.h>.
—Jens_______________________________________________
So in the real-world is it common to just present file manager-related
errors other than the basic "file exists - replace/overwrite"? In the
case of, for example, errors that occur when the filesystem is full,
do many devs write their own NSLocalizedString to explain to the user
what's going on? Is it normal for this to be done for each of the
errors listed in these headers or are the standard Cocoa ones
sufficient? Does the system set strings for the POSIX ones as
standard at all? I ask this as POSIX error 17 raised during a copy
operation (file already exists at destination exists) gives a pretty
succinct error message that I think I should polish a little.
Thanks again,
Jon_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden