Re: system in Linux (was getenv in Linux)
- Posted by JJProg at CYBERBURY.NET
Sep 19, 1999
EU>On Sun, 19 Sep 1999, you wrote:
EU>> I am trying to use some code I wrote for DOS/Win32 on Linux. One of the
EU>> routines finds out where an included file is located (it checks the
EU>> current directory and the Euphoria include directory). To find out where
EU>> the Euphoria include directory is, it uses getenv("EUDIR") - this works
EU>> in DOS, but not on Linux. On linux, getenv("EUDIR") returns the current
EU>> directory, even though echo $EUDIR displays the correct directory. Is
EU>> this a bug or just something I'm doing wrong?
EU>Ermm.. When I run the following program from my home/irv directory, I get
EU>The EUDIR IS: /home/irv/euphoria
EU>Press Enter...
EU>sequence i
EU>i = getenv("EUDIR")
EU>printf(1,"The EUDIR IS: %s",{i})
EU>Irv
You're right. It works on my system too - I just passed it to another
function which I assumed worked.
So the problem is actually with using system under Linux. Example:
DOS: system("cd c:\\",2) -- current_dir() returns "c:\" after
Linux: system("cd /",2) -- but current_dir() doesn't return "/" after
Jeffrey Fielding
JJProg at cyberbury.net
http://members.tripod.com/~JJProg/
|
Not Categorized, Please Help
|
|