Re: Dynamic file includes
- Posted by "Christian Cuvier" <christian.cuvier at agriculture.gouv.fr> Jun 02, 2005
- 583 views
> Subject: Dynamic file includes > > > posted by: Ron Weidner <nova812 at hotmail.com> > > > How can dynamic file includes be accomplished... > > }}} <eucode> > --tested but this didn't work > sequence fn = "/blah/to/file/hello.e" > include fn > </eucode> {{{ > Using Eu 2.4, you could do this:
constant dynInc = open("dyncommands.e","w") --be sure to chooes some unique file name here puts(dynInc,"include /blah/to/file/hello.e\n") close(dynInc) include dyncommands.e
The file holding a dynamic command list must be hardcoded, but you could generate its contents as needed. This is reported not to work in 2.5, which is why I didn't switch to it, plus the added load time on my old secondary machine. Search for "dynamic include" or "local include" in the archives. The solution I'm describing was exposed in details by I. Kachan iirc. > > How can the EUDIR be configured at runtime... > > }}} <eucode> > -- again no joy here > system ("export EUINC=$EUINC:/blah/to/file/") Are you sure you can modify env variables on the fly wothout some kind of logoff/logon pair? And I'd add a \n at the end of any command string you pass to system[_exec], just in case. > puts(1, getenv("EUINC")) > </eucode> {{{ > HTH CChris