• 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: File creation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File creation


  • Subject: Re: File creation
  • From: Ondra Cada <email@hidden>
  • Date: Mon, 28 Mar 2005 04:07:53 +0200

Oh, a propos:

On 28.3.2005, at 3:59, Charilaos Skiadas wrote:

To implement a save as ... function in my application, i would like to cheat the library creating an empty file just like I would do with a "touch emptyfile.ccc" in the terminal.

How about [[NSFileManager defaultManager] createFileAtPath:@"emptyfile.ccc" contents:nil attributes:nil] ?

Do always in Cocoa apps use absolute paths (if needed, generated programmatically using NSBundle or FSFindFolder or so). When using relative ones, you'll bump into diverse problems which I haven't time at the moment to list :)


But if this doesn't work, you could just set up a little NSTask.

Although it definitely is possible, in this case it seems to be just a slight overkill :)
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc


_______________________________________________
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


References: 
 >Re: File creation (From: Charilaos Skiadas <email@hidden>)

  • Prev by Date: Re: NSDocument data-based primitives
  • Next by Date: [pool release] causes error?
  • Previous by thread: Re: File creation
  • Next by thread: NSDocument data-based primitives
  • Index(es):
    • Date
    • Thread