Finding the path to a executable?

Andre Artus andre.artus at gmail.com
Tue Aug 6 23:25:24 PDT 2013


On Wednesday, 7 August 2013 at 06:10:35 UTC, Alan wrote:
> 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.


Sorry, I misunderstood.



More information about the Digitalmars-d mailing list