[Zope-dev] Extrenal method unable to run the os.popen() or
os.system() commands
Dieter Maurer
dieter at handshake.de
Fri Feb 9 13:58:06 EST 2007
Ridzwan Aminuddin wrote at 2007-2-9 00:47 -0800:
> ...
> command = "cd "+homedir
> os.popen(command)
This "popen" is useless.
It will change the working directory in the new (!) process that executes
"command". But the effect is lost as soon as the process ends (after the
"cd" has been executed).
"os.popen('cd ...')" will not affect the working directory
of the Zope process (or any later 'os.popen').
Be warned: you should *not* change Zope's working directory.
Changing global resources (such as the working directory) is
dangerous in a multi thread environment (such as Zope).
--
Dieter
More information about the Zope-Dev
mailing list