os.spawnl and zip on linux
aseem at neurobs.com
Sat Aug 10 23:52:42 CEST 2002
I am trying to call 'zip'(linux) from within my python code. The is
what I do:
### SRC ###
src_dir = 'some_dir'
cmd_apth = '/usr/bin/zip'
zip_file_name = 'res.zip'
result = os.spawnl(os.P_WAIT,cmd_path,'-rv',zip_file_name,'.')
### END SRC ###
the result is always 12 (zip error: Nothing to do). zip creates the
directory structures in the zip file but does not put in the actual
Now if I do an os.system instead of an os.spawnl it works, however I
do not want to use and cannot use os.system for application reasons.
What is going on here??
Also I have been able to use 'unzip'(Linux) in the same manner without
So what am I doing wrong here?? Why shouldnt it work??
More information about the Python-list