Recent

Author Topic: Path Local (Windows and Linux)  (Read 3471 times)

clafab

  • Newbie
  • Posts: 3
Path Local (Windows and Linux)
« on: August 11, 2010, 05:29:43 pm »
this in windows but in linux??
ExtractFilePath(application.exename)

exist a code global for indicate the local path ???

BlueIcaro

  • Hero Member
  • *****
  • Posts: 793
    • Blog personal
Re: Path Local (Windows and Linux)
« Reply #1 on: August 11, 2010, 08:03:23 pm »
Look this:

Quote
{$ifdef win32}
 ConfigFilePath := ExtractFilePath(Application.EXEName) + 'myapp.ini';
{$endif}
{$ifdef Unix}
 ConfigFilePath := GetAppConfigFile(False) + '.conf';
{$endif}
From here: http://wiki.lazarus.freepascal.org/Multiplatform_Programming_Guide#Working_with_files_and_folders
/BlueIcaro

Bart

  • Hero Member
  • *****
  • Posts: 5290
    • Bart en Mariska's Webstek
Re: Path Local (Windows and Linux)
« Reply #2 on: August 12, 2010, 01:34:34 pm »
Better use GetAppConfigFile in both cases (Win/Linux), since on modern Windows (> Win9x) you need administrator rights to write in %ProgramFiles% and subdirectories.

Bart

 

TinyPortal © 2005-2018