[Issue 4585] DMD2 should look for dmd2.conf

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 6 04:41:10 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4585



--- Comment #4 from Steven Schveighoffer <schveiguy at yahoo.com> 2010-08-06 04:41:09 PDT ---
(In reply to comment #3)
> (In reply to comment #2)
> > Does argv[0] contain full path to the binary?
> 
> No, at least on unix, is the same command you typed, but you can always do
> basename(argv[0]) and search for that file where the dmd binary (which is
> already searched by DMD) is, and the other search paths.

Yes, you can find the path to the binary, or at least the command being run (if
its a symlink) by searching the PATH.  I think DMD already must do this,
because argv[0] is pretty much what's available to find the executable
directory in the first place.

> So I think is a viable option. I find a little odd that the config file changes
> if you change the binary name, but I can see how it can be pragmatic.

Often, I have several dmd2 compilers that I want to test because I'm working on
bugs in phobos or because I want to know where a regression happened. 
Currently, I have to specify the full path to the exe, it would be nice to just
have them all live in the same directory, and I could then put that dir in my
path.

So your original solution wouldn't work for this.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list