[Zope] Python script problem

List Subscriber @ Neurobs list_subscriber@neurobs.com
Sat, 10 Aug 2002 02:57:52 -0700


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.

------------------------------------------------------------------------