Re: Include File Relative Paths
- Posted by c.k.lester <euphoric at cklester.com> Mar 07, 2007
- 561 views
Derek Parnell wrote: > c.k.lester wrote: > > I'm including a file that is in a subdirectory. I would like to keep the > > relative file path references in the include file to accommodate updates, > > etc. > > Is there a fix for this? or what is a reasonable workaround? > You will have to run some code in the include file to find itself. That is, > you > will have to look for "system/myfile.e" in the command_line()[1] directory, > then > in the directories mentioned in $EUINC symbol, and finally in the > $EUDIR/include > directory. Hey, Derek, I figure you or Matt (or any of the leet Euphoria programmers out there!) could resolve this with a little bit o' code in the interpreter, couldn't you? :) How much would it take to put this in Euphoria: that it also checks the containing directory of the included file? Why wouldn't that be seen as a good thing? Rob? I can tell you why it's necessary: CGI programming. Also, usability (and ease-of-use), and development simplicity. Unless there's a better way. But I don't see it, and I checked the forums and saw Derek's suggestion for using the ^ symbol to indicate an include file is to be found relative to the including file's home directory. But that wouldn't affect using open() from an included file that's in a subdirectory, would it? Anyway, to whomever: make it so. Pretty please. :)