On Tuesday, 29 May 2018 at 21:41:37 UTC, Ali Çehreli wrote:
On 05/29/2018 02:34 PM, DigitalDesigns wrote:
> auto x(string fp = __FULL_FILE_PATH__)()
{
pragma(msg, fp);
}
?
__FILE_FULL_PATH__
https://dlang.org/spec/expression#specialkeywords
Ali
Lol, thanks:
On 5/29/18 5:34 PM, DigitalDesigns wrote:
On Wednesday, 27 July 2016 at 13:58:22 UTC, Jonathan Marler wrote:
On Thursday, 21 July 2016 at 19:54:34 UTC, Jonathan Marler wrote:
Is there a way to get the full path of the current source file?
Something like:
__FILE_FULL_PATH__
I'm asking
On 05/29/2018 02:34 PM, DigitalDesigns wrote:
> auto x(string fp = __FULL_FILE_PATH__)()
{
pragma(msg, fp);
}
?
__FILE_FULL_PATH__
https://dlang.org/spec/expression#specialkeywords
Ali
On Wednesday, 27 July 2016 at 13:58:22 UTC, Jonathan Marler wrote:
On Thursday, 21 July 2016 at 19:54:34 UTC, Jonathan Marler
wrote:
Is there a way to get the full path of the current source
file? Something like:
__FILE_FULL_PATH__
I'm asking because I'm rewriting a batch script in D, meant
On Thursday, 21 July 2016 at 19:54:34 UTC, Jonathan Marler wrote:
Is there a way to get the full path of the current source file?
Something like:
__FILE_FULL_PATH__
I'm asking because I'm rewriting a batch script in D, meant to
be ran with rdmd. However, the script needs to know it's own
On Thursday, 21 July 2016 at 19:54:34 UTC, Jonathan Marler wrote:
Is there a way to get the full path of the current source file?
Something like:
__FILE_FULL_PATH__
I'm asking because I'm rewriting a batch script in D, meant to
be ran with rdmd. However, the script needs to know it's own
On Friday, July 22, 2016 19:28:05 Jonathan Marler via Digitalmars-d-learn
wrote:
> Actually I realized if __FILE__ was always absolute, then all
> your exception messages would contain the full path of the file
> it was thrown from on the machine it was compiled on. This would
> be quite odd.
In
On Friday, 22 July 2016 at 19:23:30 UTC, Steven Schveighoffer
wrote:
On 7/22/16 2:43 PM, Kagamin wrote:
On Friday, 22 July 2016 at 13:50:55 UTC, Jonathan Marler wrote:
shell/anypath> rdmd /somedir/clean.d
Removing /somedir/build...
So for command rdmd /somedir/clean.d what __FILE__ contains?
On Friday, 22 July 2016 at 19:13:31 UTC, sdhdfhed wrote:
On Friday, 22 July 2016 at 14:02:03 UTC, Jonathan Marler wrote:
The __FILE__ trait seems to be used most useful for error
messages.
Another usage is for testing parsers or string functions
directly on the source. E.g in "devel" mode
On 7/22/16 2:43 PM, Kagamin wrote:
On Friday, 22 July 2016 at 13:50:55 UTC, Jonathan Marler wrote:
shell/anypath> rdmd /somedir/clean.d
Removing /somedir/build...
So for command rdmd /somedir/clean.d what __FILE__ contains? LDC tells
me the same path as specified on the command line, and that
On Friday, 22 July 2016 at 14:02:03 UTC, Jonathan Marler wrote:
The __FILE__ trait seems to be used most useful for error
messages.
Another usage is for testing parsers or string functions directly
on the source. E.g in "devel" mode the main function
void main(string[] args)
{
On Friday, 22 July 2016 at 13:50:55 UTC, Jonathan Marler wrote:
shell/anypath> rdmd /somedir/clean.d
Removing /somedir/build...
So for command rdmd /somedir/clean.d what __FILE__ contains? LDC
tells me the same path as specified on the command line, and that
is specified relative to current
On Friday, 22 July 2016 at 09:37:24 UTC, sdhdfhed wrote:
On Friday, 22 July 2016 at 08:36:37 UTC, Jonathan Marler wrote:
On Friday, 22 July 2016 at 07:57:35 UTC, sdhdfhed wrote:
On Friday, 22 July 2016 at 07:47:14 UTC, Jonathan Marler
wrote:
On Friday, 22 July 2016 at 05:41:00 UTC, fdgdsgf
On Friday, 22 July 2016 at 13:30:10 UTC, Steven Schveighoffer
wrote:
On 7/22/16 3:47 AM, Jonathan Marler wrote:
What's wrong with __FILE__.dirName ?
It's kinda weird, sometimes I've noticed that the __FILE__
keyword is an
absolute path, and sometimes it isn't.
If you combine it with
On 7/22/16 3:47 AM, Jonathan Marler wrote:
What's wrong with __FILE__.dirName ?
It's kinda weird, sometimes I've noticed that the __FILE__ keyword is an
absolute path, and sometimes it isn't.
If you combine it with current working directory, this should give you
the full path.
Looks like
On Friday, 22 July 2016 at 10:51:57 UTC, Kagamin wrote:
Don't just ignore Adam's question :)
eh he answered it.
On Windows, it is somewhat common for things to be loaded or
modified (especially on older versions when these were still
writable...) from the program's directory. Its support
On Friday, 22 July 2016 at 07:53:17 UTC, Jonathan Marler wrote:
It's important to remember that the clean.d script is ran with
rdmd, and that it is meant to be called from any directory.
Since it's ran with rdmd, the thisExePath won't give you the
right directory, and since you can call it
On Friday, 22 July 2016 at 08:36:37 UTC, Jonathan Marler wrote:
On Friday, 22 July 2016 at 07:57:35 UTC, sdhdfhed wrote:
On Friday, 22 July 2016 at 07:47:14 UTC, Jonathan Marler wrote:
On Friday, 22 July 2016 at 05:41:00 UTC, fdgdsgf wrote:
What's wrong with __FILE__.dirName ?
It's kinda
On Friday, 22 July 2016 at 07:57:35 UTC, sdhdfhed wrote:
On Friday, 22 July 2016 at 07:47:14 UTC, Jonathan Marler wrote:
On Friday, 22 July 2016 at 05:41:00 UTC, fdgdsgf wrote:
What's wrong with __FILE__.dirName ?
It's kinda weird, sometimes I've noticed that the __FILE__
keyword is an
On Friday, 22 July 2016 at 07:57:35 UTC, sdhdfhed wrote:
On Friday, 22 July 2016 at 07:47:14 UTC, Jonathan Marler wrote:
[...]
Personally I've never seen a relative __FILE__. Is this an
issue that's confirmed ?
I mean that it would be better to fix __FILE__ so that its
result is always
On Friday, 22 July 2016 at 07:47:14 UTC, Jonathan Marler wrote:
On Friday, 22 July 2016 at 05:41:00 UTC, fdgdsgf wrote:
What's wrong with __FILE__.dirName ?
It's kinda weird, sometimes I've noticed that the __FILE__
keyword is an absolute path, and sometimes it isn't. If it was
always an
On Friday, 22 July 2016 at 06:45:58 UTC, Jacob Carlborg wrote:
On 2016-07-22 04:24, Jonathan Marler wrote:
The script depends on other files relative to where it exists
on the
file system. I couldn't think of a better design to find
these files
then knowing where the script exists, can you?
On Friday, 22 July 2016 at 05:41:00 UTC, fdgdsgf wrote:
On Thursday, 21 July 2016 at 19:54:34 UTC, Jonathan Marler
wrote:
Is there a way to get the full path of the current source
file? Something like:
__FILE_FULL_PATH__
I'm asking because I'm rewriting a batch script in D, meant to
be ran
On 2016-07-22 04:24, Jonathan Marler wrote:
The script depends on other files relative to where it exists on the
file system. I couldn't think of a better design to find these files
then knowing where the script exists, can you?
What kind of files are we talking about. Resource files, config
On Thursday, 21 July 2016 at 19:54:34 UTC, Jonathan Marler wrote:
Is there a way to get the full path of the current source file?
Something like:
__FILE_FULL_PATH__
I'm asking because I'm rewriting a batch script in D, meant to
be ran with rdmd. However, the script needs to know it's own
On Thursday, 21 July 2016 at 22:57:06 UTC, Jonathan M Davis wrote:
On Thursday, July 21, 2016 18:39:45 Steven Schveighoffer via
Digitalmars-d- learn wrote:
[...]
It would be pretty terrible actually to put the executable in
the source path, and in many cases, the user wouldn't even have
the
On Friday, 22 July 2016 at 01:52:57 UTC, Adam D. Ruppe wrote:
On Thursday, 21 July 2016 at 22:47:42 UTC, Jonathan Marler
wrote:
I explain in the original post. Any ideas Adam? Thanks in
advance.
But why does the batch script use it? Since you are rewriting
anyway, maybe you can find an
On Thursday, 21 July 2016 at 22:47:42 UTC, Jonathan Marler wrote:
I explain in the original post. Any ideas Adam? Thanks in
advance.
But why does the batch script use it? Since you are rewriting
anyway, maybe you can find an easier/better way to achieve the
goal.
On Thursday, July 21, 2016 19:54:34 Jonathan Marler via Digitalmars-d-learn
wrote:
> Is there a way to get the full path of the current source file?
> Something like:
>
> __FILE_FULL_PATH__
>
> I'm asking because I'm rewriting a batch script in D, meant to be
> ran with rdmd. However, the script
On Thursday, July 21, 2016 18:39:45 Steven Schveighoffer via Digitalmars-d-
learn wrote:
> On 7/21/16 3:54 PM, Jonathan Marler wrote:
> > Is there a way to get the full path of the current source file?
> > Something like:
> >
> > __FILE_FULL_PATH__
> >
> > I'm asking because I'm rewriting a batch
On Thursday, 21 July 2016 at 22:39:45 UTC, Steven Schveighoffer
wrote:
On 7/21/16 3:54 PM, Jonathan Marler wrote:
Is there a way to get the full path of the current source file?
Something like:
__FILE_FULL_PATH__
I'm asking because I'm rewriting a batch script in D, meant to
be ran
with
On Thursday, 21 July 2016 at 22:33:39 UTC, Adam D. Ruppe wrote:
On Thursday, 21 July 2016 at 22:28:39 UTC, zabruk70 wrote:
won't? what this means?
That gives the path to the .exe but he wants the path to the .d.
But why? I would think the current working directory is
probably adequate and
On 7/21/16 3:54 PM, Jonathan Marler wrote:
Is there a way to get the full path of the current source file?
Something like:
__FILE_FULL_PATH__
I'm asking because I'm rewriting a batch script in D, meant to be ran
with rdmd. However, the script needs to know it's own path. The
original batch
On Thursday, 21 July 2016 at 22:28:39 UTC, zabruk70 wrote:
won't? what this means?
That gives the path to the .exe but he wants the path to the .d.
But why? I would think the current working directory is probably
adequate and that's easy to get...
On Thursday, 21 July 2016 at 19:54:34 UTC, Jonathan Marler wrote:
thisExePath won't work.
won't? what this means?
this work on my windows
import std.file: thisExePath;
import std.stdio: writeln;
void main()
{
writeln(thisExePath());
}
Is there a way to get the full path of the current source file?
Something like:
__FILE_FULL_PATH__
I'm asking because I'm rewriting a batch script in D, meant to be
ran with rdmd. However, the script needs to know it's own path.
The original batch script uses the %~dp0 variable for this,
36 matches
Mail list logo