Finding the D compiler programatically.

Charlie charlie.fats at gmail.com
Tue Mar 6 16:50:54 PST 2007


Nathan Petrelli wrote:
> My program needs to call DMD / GDC to compile a generated class. So, how can I find where the user installed it's dmd.exe / gdc on windows and linux?
> 
> Right now I'm checking the following paths to see if it exists:
> 
> C:\dmd\bin\dmd.exe
> C:\Program Files\dmd\bin\dmd.exe
> any folder in %PATH%
> 
> and similar algorithm for GDC on linux but it doesn't seems like a very good idea to check all those paths.
> 
> Is there a better way?
> 
> Thanks.
> 

I think searching path on windows is a good idea, you could do the same 
on linux, or 'which dmd' should report it ?

Charlie



More information about the Digitalmars-d mailing list