[Issue 2103] New: import expression with relative path fails on Linux

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 12 19:36:44 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2103

           Summary: import expression with relative path fails on Linux
           Product: D
           Version: 1.028
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: wbaxter at gmail.com


This fails using dmd/dsss on Linux even when -J. is specified.

   string code = import("relative/file.txt");

Assuming your main.d is in . and there exists a file ./relative/file.txt.  It
should look relative to the current dir but for some reason it does not work on
Linux.  Works fine on Windows though.

Making a symlink and importing "file.txt" instead is a workaround: 
   ln -s relative/file.txt ./file.txt


-- 



More information about the Digitalmars-d-bugs mailing list