[fpc-pascal] specifying the relative path to a file that is located in the same folder as the application bundle?

Ken G. Brown kbrown at mac.com
Thu Feb 5 19:05:55 CET 2009


Whew! Thx!
I was part way through all that but wasn't sure what I could pass to reset();
Digging through it now. I haven't dealt with this stuff before.

Ken

At 6:24 PM +0100 2/5/09, Jonas Maebe apparently wrote:
>On 05 Feb 2009, at 17:03, Ken G. Brown wrote:
>
>>Thx for the quick response!
>>I think I'm almost there. I seem to have a bundlePath : CFURLRef; but I don't quite know what to do with it. How do I convert it to something I can use in a Reset() to open a file?
>
>If you enter CFURLRef in the search box at the top right point of the page, the first link in the search results is http://developer.apple.com/documentation/CoreFoundation/Reference/CFBundleRef/Reference/reference.html
>
>The Overview section notes:
>
>***
>You can also obtain locations of subdirectories in a bundle represented as CFURL objects. The CFBundleCopyExecutableURL function returns the location of the application's executable. The functions CFBundleCopyResourceURL, CFBundleCopySharedFrameworksURL, CFBundleCopyPrivateFrameworksURL,CFBundleCopySharedSupportURL, and CFBundleCopyBuiltInPlugInsURL return the location of a bundle's subdirectory containing resources, shared frameworks, private frameworks, shared support files, and plug-ins
>***
>
>Clicking on CFURLRef in the declarations of these functions redirects to http://developer.apple.com/documentation/CoreFoundation/Reference/CFURLRef/Reference/reference.html#//apple_ref/doc/c_ref/CFURLRef
>
>On that page, under "Functions by Task" and then "Accessing the Parts of a URL", there is a function called CFURLCopyFileSystemPath. This function can return a POSIX path (kCFURLPOSIXPathStyle) in a CFStringRef.
>
>Clicking on CFStringRef redirects to http://developer.apple.com/documentation/CoreFoundation/Reference/CFStringRef/Reference/reference.html#//apple_ref/doc/c_ref/CFStringRef
>
>There, under "Functions by Task" and then "String File System Representations", there is a function called CFStringGetFileSystemRepresentation, which in combination with CFStringGetMaximumSizeOfFileSystemRepresentation can be used to obtain a null-terminated string containing a path that can be passed to reset etc.
>
>
>Jonas
>_______________________________________________
>fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
>http://lists.freepascal.org/mailman/listinfo/fpc-pascal




More information about the fpc-pascal mailing list