Re: Finding the path to a executable?

2013-08-10 Thread Nick Sabalausky
On Sun, 11 Aug 2013 00:45:43 -0400 Nick Sabalausky wrote: > On Wed, 7 Aug 2013 10:06:19 -0700 > "H. S. Teoh" wrote: > > > On Wed, Aug 07, 2013 at 12:55:10PM -0400, Nick Sabalausky wrote: > > > > > If it were up to me, args[0] would be eliminated outright. > > > > Naw, there are some valid use

Re: Finding the path to a executable?

2013-08-10 Thread Nick Sabalausky
On Wed, 7 Aug 2013 10:06:19 -0700 "H. S. Teoh" wrote: > On Wed, Aug 07, 2013 at 12:55:10PM -0400, Nick Sabalausky wrote: > > > If it were up to me, args[0] would be eliminated outright. > > Naw, there are some valid use cases for it. Take a look at busybox, > for example. :) > Hmm, interestin

Re: Finding the path to a executable?

2013-08-07 Thread H. S. Teoh
On Wed, Aug 07, 2013 at 12:55:10PM -0400, Nick Sabalausky wrote: > On Wed, 07 Aug 2013 09:13:03 +0200 > "Tommi" 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

Re: Finding the path to a executable?

2013-08-07 Thread Nick Sabalausky
On Wed, 07 Aug 2013 09:13:03 +0200 "Tommi" 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 wordi

Re: Finding the path to a executable?

2013-08-07 Thread Jacob Carlborg
On 2013-08-07 07:31, 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.

Re: Finding the path to a executable?

2013-08-07 Thread Manfred Nowak
evilrat wrote: > in theory should always return actual program path Which theory? Especially in heteromorphic systems there is no such thing like a unique path between two accessible "points" in a file system. -manfred

Re: Finding the path to a executable?

2013-08-07 Thread Tommi
...sorry, add import std.path; if you need the last two functions.

Re: Finding the path to a executable?

2013-08-07 Thread Tommi
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 ~/pr

Re: Finding the path to a executable?

2013-08-06 Thread evilrat
On Wednesday, 7 August 2013 at 06:38:29 UTC, Kapps wrote: On Wednesday, 7 August 2013 at 06:22:25 UTC, evilrat wrote: On Wednesday, 7 August 2013 at 06:18:26 UTC, Alan wrote: Believe me I have tried all sorts of combonations of this but it's not guarunteed accuracy in certain situations, I thou

Re: Finding the path to a executable?

2013-08-06 Thread Kapps
On Wednesday, 7 August 2013 at 06:22:25 UTC, evilrat wrote: On Wednesday, 7 August 2013 at 06:18:26 UTC, Alan wrote: Believe me I have tried all sorts of combonations of this but it's not guarunteed accuracy in certain situations, I thought there would be a solution in phobos library I was miss

Re: Finding the path to a executable?

2013-08-06 Thread Kapps
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 ~/pr

Re: Finding the path to a executable?

2013-08-06 Thread Andre Artus
On Wednesday, 7 August 2013 at 06:22:25 UTC, evilrat wrote: On Wednesday, 7 August 2013 at 06:18:26 UTC, Alan wrote: Believe me I have tried all sorts of combonations of this but it's not guarunteed accuracy in certain situations, I thought there would be a solution in phobos library I was miss

Re: Finding the path to a executable?

2013-08-06 Thread Alan
On Wednesday, 7 August 2013 at 06:25:26 UTC, Andre Artus wrote: 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 a

Re: Finding the path to a executable?

2013-08-06 Thread Alan
On Wednesday, 7 August 2013 at 06:22:25 UTC, evilrat wrote: On Wednesday, 7 August 2013 at 06:18:26 UTC, Alan wrote: Believe me I have tried all sorts of combonations of this but it's not guarunteed accuracy in certain situations, I thought there would be a solution in phobos library I was miss

Re: Finding the path to a executable?

2013-08-06 Thread Andre Artus
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

Re: Finding the path to a executable?

2013-08-06 Thread evilrat
On Wednesday, 7 August 2013 at 06:18:26 UTC, Alan wrote: Believe me I have tried all sorts of combonations of this but it's not guarunteed accuracy in certain situations, I thought there would be a solution in phobos library I was missing but maybe I will have to write something complex out. T

Re: Finding the path to a executable?

2013-08-06 Thread Alan
On Wednesday, 7 August 2013 at 06:13:59 UTC, evilrat 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

Re: Finding the path to a executable?

2013-08-06 Thread evilrat
On Wednesday, 7 August 2013 at 06:10:16 UTC, Ali Çehreli wrote: First program argument is the absolute path to the executable. (I am not sure whether this is portable.) import std.stdio; import std.path; void main(string[] args) { writefln("I am program '%s' in '%s'.", baseN

Re: Finding the path to a executable?

2013-08-06 Thread Alan
On Wednesday, 7 August 2013 at 06:10:16 UTC, Ali Çehreli wrote: On 08/06/2013 10:31 PM, 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 con

Re: Finding the path to a executable?

2013-08-06 Thread Ali Çehreli
On 08/06/2013 10:31 PM, 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 Progr

Re: Finding the path to a executable?

2013-08-06 Thread Alan
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 wordi

Re: Finding the path to a executable?

2013-08-06 Thread evilrat
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 ~/pr

Re: Finding the path to a executable?

2013-08-06 Thread Andre Artus
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 ~/pr

Finding the path to a executable?

2013-08-06 Thread Alan
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 w