Bug 2759 – ImportExpression does not respect relative paths

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
Linux
Creation time
2009-03-24T20:14:00Z
Last change time
2014-04-18T09:12:02Z
Assigned to
bugzilla
Creator
cslush

Comments

Comment #0 by cslush — 2009-03-24T20:14:52Z
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?
Comment #1 by cslush — 2009-03-24T20:20:23Z
*** This bug has been marked as a duplicate of 2103 ***