• 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
Re: Can't create temporary file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't create temporary file


  • Subject: Re: Can't create temporary file
  • From: Sean McBride <email@hidden>
  • Date: Fri, 20 May 2011 15:44:15 -0400
  • Organization: Rogue Research Inc.

On Thu, 19 May 2011 22:43:06 -0700, Joar Wingfors said:

>> 	[[NSData data] writeToURL: myURL options: 0 error: &error];
>
>
>Or:
>
>	[[NSFileManager defaultManager] createFileAtPath: path contents: nil
>attributes: nil];
>
>...but yeah, it doesn't take an URL, and it doesn't return an error on
>failure. Good topic for an enhancement request on Foundation IMO.

They appear to have already thought about it, as NSFileManager.h says:

/* These methods are provided here for compatibility. The corresponding
methods on NSData which return NSErrors should be regarded as the
primary method of creating a file from an NSData or retrieving the
contents of a file as an NSData.
 */
- (NSData *)contentsAtPath:(NSString *)path;
- (BOOL)createFileAtPath:(NSString *)path contents:(NSData *)data
attributes:(NSDictionary *)attr;

Oh how I hate how one must always check BOTH the .h and the docs, as
neither says what the other says.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

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

  • Follow-Ups:
    • Re: Can't create temporary file
      • From: Quincey Morris <email@hidden>
References: 
 >Can't create temporary file (From: Rick Mann <email@hidden>)
 >Re: Can't create temporary file (From: Quincey Morris <email@hidden>)
 >Re: Can't create temporary file (From: Rick Mann <email@hidden>)
 >Re: Can't create temporary file (From: Quincey Morris <email@hidden>)
 >Re: Can't create temporary file (From: Joar Wingfors <email@hidden>)

  • Prev by Date: Re: The simplest way to fade out a view
  • Next by Date: Re: Can't create temporary file
  • Previous by thread: Re: Can't create temporary file
  • Next by thread: Re: Can't create temporary file
  • Index(es):
    • Date
    • Thread