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

Travis Siegel tsiegel at softcon.com
Fri Feb 6 14:25:28 CET 2009


So, as someone who only uses terminal apps written in fpc ( since  
ibuilder isn't really that usable and writing interface generating  
code is still beyond me despit trying for 4 years) Could you please  
post a copy of a code segment that shows how you performed this little  
marvel of finding files inside the app bundle? I've been trying  
(unsuccessfully) to imitate compiled programs by running interpreters  
on files located inside an app bundle.  Thus far, I've had little  
success, but if you've gotten this working, then it's exactly what I  
was trying to do, and I sure could use your hard work. :-).


On Feb 5, 2009, at 9:05 PM, Ken G. Brown wrote:

> Thanks a bunch for all the help!
> My legacy OS 9 app is now upgraded to OS X and working!
> It put up a hell of a fight but with all your help, the obstacles  
> have been overcome.
> Awesome!
>
> Ken G. Brown
>
> At 9:51 PM +0100 2/5/09, Jonas Maebe apparently wrote:
>> <>
>> You have to allocate memory for it. Something like
>>
>> myBundlePathStr 
>> := 
>> getmem 
>> (CFStringGetMaximumSizeOfFileSystemRepresentation(bundlePathStr));
>> success := CFStringGetFileSystemRepresentation (bundlePathStr,  
>> myBundlePathStr,  
>> CFStringGetMaximumSizeOfFileSystemRepresentation(bundlePathStr));
>>
>> When interfacing with C routines, you have to do the same things as  
>> if you were using C.
>>
>>> And I notice that CFStringGetFileSystemRepresentation is only  
>>> available for 10.4 and newer. What do i need to do instead if  
>>> wanting to deploy to 10.3.9?
>>
>> Call CFStringGetCStringPtr and/or CFStringGetCStringPtr and tell it  
>> to convert to utf-8 (kCFStringEncodingUTF8).
>>
>>
>> Jonas
>> _______________________________________________
>> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
> _______________________________________________
> 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