[Issue 4585] DMD2 should look for dmd2.conf
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Aug 6 05:31:31 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4585
Jacob Carlborg <doob at me.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |doob at me.com
--- Comment #5 from Jacob Carlborg <doob at me.com> 2010-08-06 05:31:29 PDT ---
(In reply to comment #4)
> (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.
There are system functions to get the path to the currently running executable.
I made a function for this to Tango that works on Windows, Linux, Mac OS X and
FreeBSD: http://dsource.org/projects/tango/attachment/ticket/1536/process.d .
I'm willing to license the code to whatever license necessary for inclusion in
dmd.
> > 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