• 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: Trouble using createFileAtPath method to create file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trouble using createFileAtPath method to create file


  • Subject: Re: Trouble using createFileAtPath method to create file
  • From: glenn andreas <email@hidden>
  • Date: Fri, 12 Oct 2007 09:22:18 -0500


On Oct 12, 2007, at 9:10 AM, Jaime Rios wrote:

Hi,
I'm having trouble using the createFileAtPath method to create a file in the
following directory:
/private/var/tmp/folders.501/Cleanup At Startup


The code that I am using to attempt creating the file is:
NSString* pFP = [(NSString*)sourcePath stringByAppendingPathComponent:
[NSString stringWithCString:fileName encoding:30]];

1) What is encoding 30? You should use one of the predefined symbolic constants, not some value like 30.


2) How are you getting that sourcePath? If you've hardcoded it in, you're just begging for trouble, even if it it does work (since that won't work for other users). Your best bet is to use FSFindFolder, use CFURLCreateFromFSRef to convert that fsref to a URL, and then get the path from that.





Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate | images, textures, fractals, art



_______________________________________________

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: Trouble using createFileAtPath method to create file
      • From: "Jaime Rios" <email@hidden>
References: 
 >Trouble using createFileAtPath method to create file (From: "Jaime Rios" <email@hidden>)

  • Prev by Date: Re: Getting a NSMenuItem to respond to two different key equivalents
  • Next by Date: Re: Highlighting NSView used in NSStatusItem
  • Previous by thread: Trouble using createFileAtPath method to create file
  • Next by thread: Re: Trouble using createFileAtPath method to create file
  • Index(es):
    • Date
    • Thread