[Bf-committers] Re: [Bf-blender-cvs] CVS commit: blender/source/blender/src language.c

Stephen Swaney sswaney at centurytel.net
Wed Mar 2 12:30:17 CET 2005


On Wed, Mar 02, 2005 at 02:34:20PM +0200, Daniel Fairhead wrote:
> > > ===========> argv[0] <===============
> > > contains the COMPLETE PATH to the binary.
> >
> > Actually, it is not so trivial, 

This is a FAQ on comp.lang.c:

Q: How can my program discover the complete pathname to the
executable from which it was invoked?

A: argv[0] may contain all or part of the pathname.  You may be
able to duplicate the command language interpreter's search path
logic to locate the executable.


> On linux, /proc/self/exe is a symlink to the absolute location of the
> executable. I don't know if this is cross platform ?

Probably not cross platform.  And probably only on linux kernels 
that have been built with the /proc filesystem

-- 
Stephen Swaney			
sswaney at centurytel.net



More information about the Bf-committers mailing list