[Twisted-Python] Processes in Twisted, only possible to run external prog?
Maarten ter Huurne
maarten at treewalker.org
Fri Aug 29 05:23:50 EDT 2008
On Friday 29 August 2008, Gabriel Rossetti wrote:
> Here's the problem : I need to run a windows executable (proprietary,
> they won't give us the code) with wine to do some audio compression. I
> need to do different processing before (like calling sox, or parsing
> files, etc) so I wrote some functions that do everything. The windows
> exec creates a tmp file named "_tmp" in the working dir, so if I want to
> run several in parallel, I have to create a tmp dir with a unique name
> and change the working dir, if not then the multiple executions will
> overwrite each other's tmp file. So when I call my function that does
> the whole process, I first create a tmp dir, then pass it the tmp dir
> and the input filename, then once inside the function, it does an
> os.chDir() into the tmp dir and at the end it does it again to go back
> to the original current dir. Then I run that function in threads. The
> problem is that threads share the current dir :
Maybe you could bypass this problem by generating a short shell script that
does "cd" before it starts Wine? Since the shell will be a separate
process, it has its own working dir.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 194 bytes
Desc: This is a digitally signed message part.
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20080829/6cdfa031/attachment.pgp
More information about the Twisted-Python