NSData returns YES on Fail?
NSData returns YES on Fail?
- Subject: NSData returns YES on Fail?
- From: Seth Willits <email@hidden>
- Date: Fri, 16 Sep 2005 16:49:25 -0700
I'm using NSData's writeToURL method to write to a potentially
protected file. When I try to write to some place I don't have
permission (like /etc/httpd/httpd.conf) NSData returns YES (which is
returned as the result of NSDocument's writeToURL:ofType:error:) even
though it should fail, and yet somehow the document presents the
permissions error sheet.
What's going on?
- (BOOL)writeToURL:(NSURL *)absoluteURL ofType:(NSString *)docType
error:(NSError **)outError
{
BOOL result;
NSData * data;
...
result = [data writeToURL:absoluteURL options:NSAtomicWrite
error:outError];
// result is always YES
return result;
}
--
Seth Willits
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden