• 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: API Path Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: API Path Question


  • Subject: Re: API Path Question
  • From: Jerrod Fowkes <email@hidden>
  • Date: Mon, 12 Jun 2006 07:22:56 -0700 (PDT)

Nick Zitzmann <email@hidden> wrote: You can create an NSURL with that path and then use the
CFURLCopyFileSystemPath() function to get a string in HFS path format.

Nick Zitzmann

I have been able to generate the following code:

NSString* theURL = @"/Users/useronfilesystem/documents/u i.yui";
CFStringRef escapedURL = nil;
escapedURL = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
(CFStringRef)theURL, NULL, NULL, kCFStringEncodingUTF8);


CFURLRef anURL = nil;
anURL = CFURLCreateWithString(NULL, escapedURL, NULL);

CFStringRef filePath = nil;
filePath = CFURLCopyFileSystemPath(anURL, kCFURLHFSPathStyle);

I needed it to be able to support spaces as well. I am guessing that this would be the correct solution if I were to represent any filename on the filesystem.
Confirmation of this would be nice.

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 _______________________________________________
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: API Path Question
      • From: Nick Zitzmann <email@hidden>
References: 
 >Re: API Path Question (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: [ANN] F-Script 1.3.3 - Interactive and scripting environement for Cocoa
  • Next by Date: Icon button with pop-up menu in toolbar?
  • Previous by thread: Re: API Path Question
  • Next by thread: Re: API Path Question
  • Index(es):
    • Date
    • Thread