Finding the path to a executable?

Alan alanpotteiger at gmail.com
Tue Aug 6 23:10:33 PDT 2013


On Wednesday, 7 August 2013 at 06:08:44 UTC, Andre Artus wrote:
> On Wednesday, 7 August 2013 at 05:31:24 UTC, Alan wrote:
>> Hello!  This may seem like a simple question, maybe an 
>> embarassing question but how would I fetch the absolute path 
>> to the directory where my executable is located?  My wording 
>> is known to be confusing so I will give an example:
>>
>> cd ~/projects/program
>> dmd Program.d -ofProgram
>>
>> That executable would be located in 
>> /home/alan/projects/program for example.  SO my question is 
>> how would I fetch the absolute path to that directory?
>>
>> Thanks for any help!
>
> Is this what you are looking for?
>
> find ~/projects/program/ -type f -perm +111
> or
> ls -d -1 ~/projects/program/*

No sorry, I meant how to find the directory in D code.


More information about the Digitalmars-d mailing list