Bug in -J
rikki cattermole via Digitalmars-d
digitalmars-d at puremagic.com
Fri Aug 11 19:45:30 PDT 2017
On 12/08/2017 3:34 AM, Mr. Pib wrote:
> I have -J added to the command line like
>
> -JC:\Temp
>
> I then use import(r"C:\Temp\a.dat");
>
> and I get an error about the file not existing in the
>
> main.d: Error: file "C:\\Temp\\a.dat" cannot be found or not in a path
> specified with -J
>
> It seems dmd does internally compare the paths to see if they are
> identical.
>
> Of course, removing the C:\Temp\ part of import works fine.
>
> The problem with that approach is it then is not consistent with other
> code. I need to specify the full path because sometimes it is used.
>
> essentially
>
> version(X)
> import(path)
> else
> load(path);
>
> while I could do something like
>
> import(baseName(path))
>
> it seems kinda clunky, in any case. It's pretty obvious that one excepts
> the same behavior so it could create bugs in code that except the
> behavior to work correctly.
Most likely related or is the issue[0].
[0] https://issues.dlang.org/show_bug.cgi?id=3420
More information about the Digitalmars-d
mailing list