[fpc-pascal] Re: specifying the relative path to a file that is located in the same folder as the application bundle?
Paul Nicholls
paulfnicholls at gmail.com
Thu Feb 5 22:52:29 CET 2009
"Ken G. Brown" <kbrown-ee4meeAH724 at public.gmane.org> wrote in message
news:p06240407c5b049e88bbd@[10.0.1.199]...
> MacOS X, 10.5.6, fpc 2.2.2
>
> How can I find the directory path to the executable of the currently
> executing program from within the program?
>
> Or alternately, how can I specify the relative path to a file that is
> located in the same folder as the application bundle for my currently
> executing program?
>
> Using ./filename does not appear to work for me.
>
> Are there file and directory type utilities available? Where can I read up
> on them?
>
> Thx for any tips,
> Ken G. Brown
> _______________________________________________
> fpc-pascal maillist -
> fpc-pascal-PD4FTy7X32k2wBtHl531yWD2FQJk+8+b at public.gmane.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
Maybe I haven't understood you completely, but have you tried this?
MyProgramFolder := ExtractFilePath(ParamStr(0));
This should hopefully get you the folder of the currently running program
from within the program (at least under Win32 and Linux).
cheers,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20090206/32f3771e/attachment.html>
More information about the fpc-pascal
mailing list