On Wednesday, 10 July 2013 at 12:20:14 UTC, eles wrote:
On Wednesday, 10 July 2013 at 12:14:39 UTC, eles wrote:
On Wednesday, 10 July 2013 at 12:03:06 UTC, eles wrote:
On Wednesday, 10 July 2013 at 10:24:17 UTC, Joseph Rushton Wakeling wrote:
On 07/10/2013 02:07 AM, H. S. Teoh wrote:
Comments / flames / pull requests welcome. ;-)

 string findGDC(string argv0)
 {
     // FIXME: this does not work 100% of the time.
auto c = match(baseName(argv0), `^(.*-)?g?dmd(-.*)?$`).captures;
     auto targetPrefix = c[1];
     auto gdcDir = absolutePath(dirName(argv0));
return buildNormalizedPath(gdcDir, targetPrefix ~ "gdc" ~ c[2]);
 }

Actually, I think this is better

or worse. Since it asks findGDC() to unwind, then wind again the path towards gdc.

Isn't resonable to implement a Linux-like "which" function? Could even find its place in phobos.

Reply via email to