[Zope] Python script problem

Dennis Allison allison@sumeru.stanford.EDU
Mon, 12 Aug 2002 11:00:15 -0700 (PDT)


Ah, you didn't mention what you were trying to accomplish, only a
mechanism.  os.system() is blocking.  I suppose the quick and simple
hack would be to append a '&' to the command string and fire off an
independent process.  I don't see any simple way to test completion
since there is nothing like "WAIT".

-dra



On Sun, 11 Aug 2002, List Subscriber @ Neurobs wrote:

> >
> >
> >
> >Unix processes want an additional "argument 0" which by default is
> >the name of the program file.
> >
> I found that out, however, heres a puzzle then:
> 
> I am doing exactly the same thing while unzipping uploaded files.... ie 
> in the code replace '/usr/bin/zip' with '/usr/bin/unzip' and hte args 
> and the other stuff... and that seems to work everytime. If agree about 
> the argv[0] thingy, however then my unzipping shouldnt work either.
> 
> Re: Dennis' solution of using os.system, the docs say if I do a system 
> it replaces the calling thread (I dont yet understand the meaning of 
> replace in this context) and only resumes after returning. In a web 
> server environ wouldnt that be dangerous as it might replace Zope's 
> calling thread even if for some time. I confess I dont know how exactly 
> the calling mechaninsm for external methods work, but if I was right I 
> would have a sequential process which would be bad for a web-site I think.
> 
> Re:Chris, I will try popen adn Zipfile again.
> 
> Thanks all.
> AM
> 
> 
> _______________________________________________
> 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 )
>