Recent

Author Topic: How do I return the directory in which my program resides / has been launched?  (Read 4584 times)

xircon

  • New Member
  • *
  • Posts: 25
Have tried GetDir & GetCurrentDir, both work in the IDE, but do not outside, when launched from cairo-dock.

Been reading the RTL pages for hours and can't spot it, too early! More coffee is requred.

Cheers

Steve

Kunstbanause

  • New Member
  • *
  • Posts: 47
Under Windows, just do:

Code: [Select]
mypath := ExtractFilePath(ParamStr(0)); // mypath is String

xircon

  • New Member
  • *
  • Posts: 25
Works on Linux as well  8-)

Thank you, just couldn't spot it!

Steve

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2673
Note that there are cases in linux where it doesn't give you the path (cant remember which)
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

 

TinyPortal © 2005-2018