Start application & continue after app exits

2005-06-09 Thread Guy Lateur
Hi all, I was wondering if it would be possible to launch an application, block until the app exits, and do some cleanup afterwards. Maybe an example will be clearer: I would like to make a temperary (text) file, open it with MS Word for the user to edit/layout/print, and then delete the temp

Re: Start application & continue after app exits

2005-06-09 Thread Paul McNett
Guy Lateur wrote: > I was wondering if it would be possible to launch an application, block > until the app exits, and do some cleanup afterwards. > Maybe an example will be clearer: I would like to make a temperary (text) > file, open it with MS Word for the user to edit/layout/print, and then

Re: Start application & continue after app exits

2005-06-09 Thread Ivan Shevanski
>From: Paul McNett <[EMAIL PROTECTED]> >To: python-list@python.org >Subject: Re: Start application & continue after app exits >Date: Thu, 09 Jun 2005 09:07:47 -0700 > >Guy Lateur wrote: > > I was wondering if it would be possible to launch an application, block &g

Re: Start application & continue after app exits

2005-06-09 Thread guy lateur
>>Also note that this method of creating tempfiles is technically unsafe, >>as it is theoretically possible that another process would create a file >>of the same name in the same directory and then try to use it, resulting >>in a race condition between the two processes. This is practically >>unli

Re: Start application & continue after app exits

2005-06-09 Thread Mike Meyer
"guy lateur" <[EMAIL PROTECTED]> writes: >>>Also note that this method of creating tempfiles is technically unsafe, >>>as it is theoretically possible that another process would create a file >>>of the same name in the same directory and then try to use it, resulting >>>in a race condition between

Re: Start application & continue after app exits

2005-06-09 Thread Paul McNett
Mike Meyer wrote: > "guy lateur" <[EMAIL PROTECTED]> writes: > > Also note that this method of creating tempfiles is technically unsafe, as it is theoretically possible that another process would create a file of the same name in the same directory and then try to use it, resulting >>

Re: Start application & continue after app exits

2005-06-09 Thread Renato Ramonda
guy lateur ha scritto: > I see what you mean, but wouldn't a call to open(fn, 'w') on a filename > that's in use (for reading or writing) result in an error condition or > something? I'm a noob, btw. Uh... no, not on linux. Try this: $ touch foo.txt $ gedit foo.txt & (write something in it an

Re: Start application & continue after app exits

2005-06-10 Thread Guy Lateur
This may be getting somewhat OT, but I'd like to dig a little deeper into this. First of all, security (as in some other proces reading/disclosing the data) is not an issue in this case. The thing is, though, a user could run the script twice, not having closed Word after the first time. So I g

Re: Start application & continue after app exits

2005-06-10 Thread Terry Reedy
"Guy Lateur" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > To be honest, I don't really understand what it means to have the same > file open for writing by several processes. You don't want to modify data > which is already being modified by someone else, do you? I mean, how do

Re: Start application & continue after app exits

2005-06-10 Thread Mike Meyer
"Guy Lateur" <[EMAIL PROTECTED]> writes: > To be honest, I don't really understand what it means to have the same file > open for writing by several processes. You don't want to modify data which > is already being modified by someone else, do you? I mean, how do you > determine what changes to