[Zope] Launching external apps to process uploads to LocalFS, possible?

sean.upton@uniontrib.com sean.upton@uniontrib.com
Thu, 08 May 2003 12:07:51 -0700

Security-wise, just hard-code the behavior into product code, perhaps hack
LocalFS to meet your needs?

I think this might be what you want, if you want the applications doing the
work to detach from Zope (otherwise use os.system() ).  This will work on
Unix, and I think on Win32.

from os import spawnv, P_NOWAIT
spawnv(P_NOWAIT, '[pathtoprog]', ('[programname]',))


>>> from os import spawnv, P_NOWAIT
>>> spawnv(P_NOWAIT, '/usr/bin/python2.1', ('python2.1',))

spawnv will return an integer pid number, which you could use or ignore.  If
the parent Python process (in this case Zope) is killed or shutdown while
the child process (spawned process) is running, the child process will be
re-parented to init and continue running until done.

-----Original Message-----
From: Chris Beaumont [mailto:cbeaumon@msri.org]
Sent: Thursday, May 08, 2003 11:57 AM
To: zope@zope.org
Subject: [Zope] Launching external apps to process uploads to LocalFS,

I'm setting up a document repository that allows people to upload files
(Using Zope) to a LocalFS directory. 

Those files then become visible through the Zope
management interface. Is there any Zope friendly way to launch external
Linux apps to process them once they have been uploaded? I'd like to
translate .dvi and Word .doc files into PDF using wvWare and dvipdfm.

I suppose I could use a cron job and a shell script to do the conversion
at regular intervals, but I'd rather do it immediately. I guess what I
am asking is if Zope's Python can be told to launch apps on the hosting
machine.. But that seems like it would be a major security hole, so I
understand if its not possible..

-Thank you,

Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )