[Zope] RE: Creating Linux DIR
Tue, 25 Jun 2002 17:44:38 -0700
I've followed Kapil's suggestions below and created an external
method called mkdirLinux:
#python script to make linux DIR
#end of mkdirLinux.py
<form action="doMkdir" method="post">
<input name="desiredDir" type="text" size="25">
<input type="submit" value="Submit!">
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
I just wanted to allow people with the role "createDIR" to create a linux
> unrestricted python code is needed (external method,
> or product). if you don't care about the response from
> the shell script then using os.system will do the
> trick.. please validate your input from the web before
> passing to something like this...
> import os
> script_command = 'mkdir /root/path/%s'
> def execute_my_script(arg):
> if you need to process output try one of the popen
> modules (see docs on python.org). ZCVS has a nice
> abstraction over this in its ShellCommandProcessor;
> --- "Tran, Mike" <email@example.com> wrote:
> > Hi All,
> > How do i create a method that will excute a shell
> > script when called?
> > I just wanted to run a local shell script when a
> > user clicks on a button.
> > Appreciate any suggestion,
> > Mike