• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSData returns YES on Fail?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSData returns YES on Fail? (With Example)
      • From: Seth Willits <email@hidden>
  • Prev by Date: Binding using multiple keys
  • Next by Date: Re: Text Array View
  • Previous by thread: Re: Binding using multiple keys
  • Next by thread: Re: NSData returns YES on Fail? (With Example)
  • Index(es):
    • Date
    • Thread