[Lazarus] need suggestion about ParamStrUTF8(0)

FreeMan freeman35 at delphiturkiye.com
Tue Feb 17 17:12:35 CET 2015

Yes, this can not be standart but, for me useful. Why, My application 
work with database, on first run, no any db created. On my login screen 
have create db form, user can create more db files. year by year or what 
they want. When db create many settings added on create. user permission 
etc. So I have to set db files folder some where. In win and linux same 
folder with application.
and some time need to help to user, first job get backup data, if all 
files be in /applications/myproject.app/....  folder, they have to just 
copy all of them,  xx gb can be, data folder used change. some time just 
one db has a problem and tey want to sent me ? can do on terminal of 
course, but how to tell this to blonde stuff on telephone :)
usually I create partition or volume, and use my application and data 
from there. And for backup, show to user this folder is all your data, 
just copy out of this computer where you want. so I any on broke system 
I'm not get risk.

     S := ParamStrUTF8(0);
    //CheckIfFileIsSymlink(S); I wish, this be a function and result be 
is fpReadLink, 'cos its in :)
     FileAttr := FileGetAttr(S);
     if(FileAttr and faSymLink)>0then S := fpReadLink(S)
     else s:= 'normal file';

On 17.02.2015 16:32, Schindler Karl-Michael wrote:
> On Tue, 17 Feb 2015 14:33:41 +0200
> FreeMan <freeman35 at delphiturkiye.com> wrote:
>>> osx yosemite fpc, lazarus svn qt x64
>>> ParamStrUTF8(0) in /lazarus/components/lazutils/fileutil.pas
>>> this function result in osx : ......./myproject.app/Contents/MacOS/myproject
>>> showing normal, but its symbolink link, not application.
>> When deploying your application you can remove the symbolic link and
>> move the binary into that folder.
>> Eventually Lazarus will put the binary into the folder.
>>> Why I need real application path, I need create some folder and create ini files in
>>> application's same folder.
>>> In osx myproject.app is a folder, and finder show it like a application,
>>> so end user not find and access to that created folder and ini files. I
>>> need real application path. How to do this?
>> Although the Finder does not show the contents of this folder by
>> default, programs can read and write there normally. You can store ini
>> files there.
>> If you want the user to see your ini files in Finder, then you should
>> create a normal directory. As far as I know there is no standard for
>> that.
> Maybe I misunderstand some details, but i understand the Apple Human Interface Guidelines that preference files should be put in ~/Library/Preferences for user specific preferences and in /Library/Preferences for global ones. Other files can be kept within the .app bundle, in particular if they should be replaced by a new installation or update and unless they should survive an update of the program. In the later case they should be placed in ~/Library/Application Support/NAME_OF_YOUR_PROGRAM or /Library/Application Support/NAME_OF_YOUR_PROGRAM if they are global. Simillarly, log files should be placed in ~/Library/Logs/NAME_OF_YOUR_PROGRAM or /Library/Logs/NAME_OF_YOUR_PROGRAM. For further details read here:
> https://developer.apple.com/library/mac/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html

More information about the Lazarus mailing list