full path to source file __FILE__

Jonathan Marler via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 21 19:31:10 PDT 2016


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 permissions for it. For instance, what if the script were 
> in /usr/local/bin? They won't have the permissions for the 
> executable to end up there, and it would just cause a bunch of 
> clutter in /usr/local/bin, since you'd get a new executable 
> every time it decided that it needed to rebuild it (and you 
> wouldn't want it to delete the executable every time, otherwise 
> it would have to rebuild it every time, making it so that it 
> would _always_ have to compile your script when it runs instead 
> of just sometimes). Right now, the executable ends up in a temp 
> directory, which makes a lot of sense.
>
> Maybe it would make sense to have such a flag for very rare 
> cases, but in general, it seems like a terrible idea.
>
> - Jonathan M Davis

I agree this isn't a very good solution for the problem at hand.  
Putting the executable in a temporary directory makes sense in 
any cases I can think of. I posted an idea for another potential 
solution 
(http://forum.dlang.org/thread/cmydxneeghtjqjroxpld@forum.dlang.org), please let me know your thoughts.  Thanks.


More information about the Digitalmars-d-learn mailing list