Re: system in Linux (was getenv in Linux)
Jeffrey Fielding writes:
> DOS: system("cd c:\\",2) -- current_dir() returns "c:\" after
> Linux: system("cd /",2) -- but current_dir() doesn't
> return "/" after
Pete's description of the subshell problem for Linux is correct.
Actually, when I first tried system("cd ...", 2) on DOS I was
somewhat surprised that it worked, since a subshell is
created on DOS too. I guess the current directory is a
global property on DOS.
I'll add a library routine in Linux, as well as DOS and
Windows, that will switch to a new current directory.
It will have the advantage of returning an error code
to indicate success or failure.
Regards,
Rob Craig
Rapid Deployment Software
http://www.RapidEuphoria.com
|
Not Categorized, Please Help
|
|