TIP: Click on subject to list as thread! ANSI
echo: pascal
to: ALL
from: `Stewart Honsberger`
date: 1999-03-08 00:00:00
subject: FPC/Linux

Under FPC/Linux, does anybody know how to get the directory the program
binary file resides in?

For DOS/Win/OS/2 programs, I use the function;

Function Exedir: String;
var
  S: string;
begin
  S := ParamStr(0);
  if Pos('\', S) > 0 then
    while S[length(S)]  '\' do Dec(S[0])
  else S := '';
  Exedir := S;
end;

(For Linux, of course, I reversed the slashes.) This procedure doesn't
seem to work for me, and for all I know, I've got files created in junk
paths :<

   Stewart Honsberger (AKA Blackdeath)     WWW: http://sprk.com/blackdeath
   E-Mail: blackdeath@tinys.oix.com        ICQ: 3484915

.. I love cats. They taste just like chicken.
-!- GOPGP/2 v1.21 
/======================================================================
| Orange County Usenet  Fidonet gateway                              
|                                                                      
| User email address:   Stewart.Honsberger.noemail@webworldinc.com                                             
| FTN email: Stewart Honsberger[RemoveThis]@f604.n229.z1.fidonet.org
| User FidoNet address: 1:229/604                                             
| Report abuse of this service to joejared@webworldinc.com

SOURCE: alt.fidonet via archive.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.