Bug in import(...) on Windows?

Steven Schveighoffer schveiguy at gmail.com
Wed Sep 2 20:51:58 UTC 2020


On 9/2/20 4:48 PM, Andrey Zherikov wrote:
> On Wednesday, 2 September 2020 at 20:23:15 UTC, Steven Schveighoffer wrote:
>> What I'm wondering is if it needs to be ./file instead of .\file. Can 
>> you hard code that and see if it works?
> 
> This actually works:
>      pragma(msg, import("file"));
>      pragma(msg, buildPath(".", "file"));
>      pragma(msg, import("./file"));
> 
> Result on Ubuntu:
> =======
> hello
> 
> ../file
> hello
> 
> =======
> 
> Result on Windows:
> =======
> hello
> 
> ..\file
> hello
> 
> =======
> 
> This seems weird that I can't use std.path functions or use valid 
> "foo\bar" paths on Windows.

I don't know why it wouldn't work with native paths on Windows. But I'm 
not a DMD maintainer, so I don't know where to look in the code to see 
why it doesn't work.

It might be worth filing a bug. https://issues.dlang.org

-Steve


More information about the Digitalmars-d-learn mailing list