www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2759] New: ImportExpression does not respect relative paths

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2759

           Summary: ImportExpression does not respect relative paths
           Product: D
           Version: 1.041
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: cslush gmail.com


Currently, when an import("file.txt") is done in code, it uses the -Jpath flag
during compile time and expects the "file.txt" to exist in the path defined by
-Jpath. If I wanted to access a file relative to the path in -Jpath, naturally
I would do an import("relative/path/to/file.txt"). This works fine in windows,
but fails in Linux.

The main reason I'd like to do this is so that I can specify a root path for
all resources that get imported at compile time and keep them tidily organized
in subdirectories.

After looking at the dmd source code, it is clear that relative pathing is
prevented. I propose that this check is removed from the compiler altogether,
so that a relative path is allowed. Any reason that this isn't allowed already?


-- 
Mar 24 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2759


cslush gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE




------- Comment #1 from cslush gmail.com  2009-03-24 20:20 -------


*** This bug has been marked as a duplicate of 2103 ***


-- 
Mar 24 2009