You'd probably have better luck asking the Python list. This doesn't have anything to do with Zope. One suggestion: I'm not sure os.chdir has any affect on spawnl. Try passing it absolute paths instead. -Casey On Saturday 10 August 2002 05:57 am, list_subscriber@neurobs.com wrote:
Hi, I am trying to call 'zip'(linux) from within my python external method. The is what I do:
### SRC ###
import os
src_dir = 'some_dir' cmd_apth = '/usr/bin/zip' zip_file_name = 'res.zip'
os.chdir(src_dir) result = os.spawnl(os.P_WAIT,cmd_path,'-rv',zip_file_name,'.') print result
### 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 files.
Now if I do an os.system instead of an os.spawnl it works, however I do not want to use it.
What is going on here?? Also I have been able to use 'unzip'(Linux) in the same manner without a hitch.
So what am I doing wrong here?? Why shouldnt it work??
TIA AM
PS: I have played around with the Python ZipFile and zlib module. Didnt feel comfy so going with this as of now, will probably switch over later.
------------------------------------------------------------------------
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )