Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't convert path ~/... to Fsref



Yes, true. If a '~' exists the home directory could be concatenated manually by calling FSFindFolder with kUserDomain and kCurrentUserFolderType then converting that FSRef to a path. Of course that's probably the kind of work you're trying to avoid. FWIW, if you're running on Tiger an linking against Carbon then you already have Foundation loaded automatically. If you can compile your code with Objective-C++ you can go ahead and use the Cocoa NSString convenience methods that have been mentioned. Cabrbon and Foundation wore very well together.


On Sep 29, 2005, at 1:36 PM, Rosyna wrote:

I don't believe that CFURLCreateWithFileSystemPath does shell expansion (the documentation makes no note of it doing this). glob does shell exapansion. You can just feed all path strings to it along with the GLOB_NOESCAPE and GLOB_TILDE flags. It will then expand any paths starting with ~ to the correct path. This is similar to NSString's -stringByExpandingTildeInPath method.

Ack, at 9/29/05, Bryan Prusha said:


How about CFURLCreateWithFileSystemPath followed by CFURLGetFSRef?

_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Can't convert path ~/... to Fsref (From: "Denis @ TheOffice" <email@hidden>)
 >Re: Can't convert path ~/... to Fsref (From: Rosyna <email@hidden>)
 >Re: Can't convert path ~/... to Fsref (From: "Denis @ TheOffice" <email@hidden>)
 >Re: Can't convert path ~/... to Fsref (From: Bryan Prusha <email@hidden>)
 >Re: Can't convert path ~/... to Fsref (From: Rosyna <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.