Re: Can't create temporary file

2011-05-20 Thread Quincey Morris
On May 20, 2011, at 12:44, Sean McBride wrote: > They appear to have already thought about it, as NSFileManager.h says: Given the pervasiveness with which NSURL-based methods were planted across the entire API landscape, I think it was pretty easy to conclude that the NSFileManager-based API di

Re: Can't create temporary file

2011-05-20 Thread Sean McBride
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 er

Re: Can't create temporary file

2011-05-19 Thread Rick Mann
On May 19, 2011, at 22:43 , Joar Wingfors wrote: > 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 I

Re: Can't create temporary file

2011-05-19 Thread Joar Wingfors
On 19 maj 2011, at 16.48, Quincey Morris wrote: >> It seems Cocoa is lacking in file-creation APIs (none URL-based, none return >> an error object). > > How about: > > [[NSData data] writeToURL: myURL options: 0 error: &error]; Or: [[NSFileManager defaultManager] createFileAtP

Re: Can't create temporary file

2011-05-19 Thread Rick Mann
On May 19, 2011, at 22:31 , Quincey Morris wrote: > On May 19, 2011, at 21:53, Rick Mann wrote: > >> But frankly, that's a kludge. Cocoa is full of inconsistencies (like >> NSFileManager/NSFileHandle lacking modern file creation methods) forcing the >> (ab)use of another API. Sure, it works (I

Re: Can't create temporary file

2011-05-19 Thread Quincey Morris
On May 19, 2011, at 21:53, Rick Mann wrote: > But frankly, that's a kludge. Cocoa is full of inconsistencies (like > NSFileManager/NSFileHandle lacking modern file creation methods) forcing the > (ab)use of another API. Sure, it works (I'm guessing), but it's ugly. It's in the eye of the behold

Re: Can't create temporary file

2011-05-19 Thread Rick Mann
On May 19, 2011, at 21:50 , Quincey Morris wrote: > On May 19, 2011, at 21:46, Rick Mann wrote: > >> >> On May 19, 2011, at 16:48 , Quincey Morris wrote: >> >>> On May 19, 2011, at 11:55, Rick Mann wrote: >>> It seems Cocoa is lacking in file-creation APIs (none URL-based, none ret

Re: Can't create temporary file

2011-05-19 Thread Quincey Morris
On May 19, 2011, at 21:46, Rick Mann wrote: > > On May 19, 2011, at 16:48 , Quincey Morris wrote: > >> On May 19, 2011, at 11:55, Rick Mann wrote: >> >>> It seems Cocoa is lacking in file-creation APIs (none URL-based, none >>> return an error object). >> >> How about: >> >> [[NSData da

Re: Can't create temporary file

2011-05-19 Thread Rick Mann
On May 19, 2011, at 16:48 , Quincey Morris wrote: > On May 19, 2011, at 11:55, Rick Mann wrote: > >> It seems Cocoa is lacking in file-creation APIs (none URL-based, none return >> an error object). > > How about: > > [[NSData data] writeToURL: myURL options: 0 error: &error]; That req

Re: Can't create temporary file

2011-05-19 Thread Quincey Morris
On May 19, 2011, at 11:55, Rick Mann wrote: > It seems Cocoa is lacking in file-creation APIs (none URL-based, none return > an error object). How about: [[NSData data] writeToURL: myURL options: 0 error: &error]; ___ Cocoa-dev mailing list

Re: Can't create temporary file

2011-05-19 Thread Rick Mann
On May 14, 2011, at 2:22 , Quincey Morris wrote: > On May 13, 2011, at 22:46, Rick Mann wrote: > >> Any idea what I'm doing wrong? > > > Well, this seems relevant: > > > http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSFileHandle_Class/Referenc

Re: Can't create temporary file

2011-05-14 Thread Fritz Anderson
On 14 May 2011, at 12:46 AM, Rick Mann wrote: >NSError* err = nil; >NSURL* tempDir = [fm URLForDirectory: NSItemReplacementDirectory >inDomain: NSUserDomainMask >appropriateForURL: inURL >create: true >

Re: Can't create temporary file

2011-05-13 Thread Quincey Morris
On May 13, 2011, at 22:46, Rick Mann wrote: > Any idea what I'm doing wrong? Well, this seems relevant: http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSFileHandle_Class/Reference/Reference.html Specifically: > fileHandleForWritingToURL:error