How to get name of my application (project)

Jonathan M Davis newsgroup.d at jmdavisprog.com
Sat Aug 3 15:58:10 UTC 2019


On Saturday, August 3, 2019 5:47:33 AM MDT Rémy Mouëza via Digitalmars-d-
learn wrote:
> On Saturday, 3 August 2019 at 09:26:03 UTC, Andrey wrote:
> > Hello, how to get name of my application (project) that we
> > write in dub.json? Is there any compile-time constant like
> > __MODULE__?
>
> If I understand the question correctly, you are looking for
> std.file.thisExePath:
> - http://dpldocs.info/experimental-docs/std.file.thisExePath.html
> - https://dlang.org/phobos/std_file.html#thisExePath

Also, the first element in the array passed to main is the name of the
executable.

- Jonathan M Davis






More information about the Digitalmars-d-learn mailing list