Re: system in Linux (was getenv in Linux)

new topic     » topic index » view thread      » older message » newer message

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

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu