[Zope] RE: Creating Linux DIR

Dieter Maurer dieter@handshake.de
Wed, 26 Jun 2002 21:35:53 +0200


Tran, Mike writes:
 > I've followed Kapil's suggestions below and created an external
 > method called mkdirLinux:
 > ...
 > def mkdirLinux(arg):
 >    os.system(script_command%arg)
 > #end of mkdirLinux.py
 > ...
 > The "doMkdir" method was called without any error.  However, the desired
 > Linux directory did not get created.  For testing purposes I've set
 > /home/test/ to chmod 777.
 > 
 > My Python is not very good.  Does anyone have any ideas what i am doing
 > wrong?
"os.system" returns "0" on success and otherwise an error indication.
It does not raise an exception in case of a problem.

What you do wrong: you do not look at "os.system"s return code...


Dieter