Re: Waiting until Acrobat closes file

2006-06-10 Thread Joel Rees
Will it work to: a) Wait until Acrobat Reader is running b) Sleep long enough ... Instead of depending on timing, which will always get messed up when you can least afford it, get a list of the open files from the system. man lsof There should be better ways to get the file handle, but you s

Re: Waiting until Acrobat closes file

2006-06-10 Thread Tommy Nordgren
On 28 maj 2006, at 01.34, David Cantrell wrote: On Sun, May 28, 2006 at 12:27:02AM +0200, Tommy Nordgren wrote: My perl script generates pdf files, and opens them with Acrobat. How can I wait until Acrobat closes the file, so I can delete it? system('acroread', 'myfile.pdf'); unlink

Re: Waiting until Acrobat closes file

2006-05-28 Thread Joseph Alotta
This may not be what you are looking for, but if you were to name the files in a way that uses the date, then you can just delete the old ones the next day. Joe. On May 28, 2006, at 5:34 PM, wren ng thornton wrote: --- Chris Devers wrote: Really?? In my experience, the `open` command immedia

Re: Waiting until Acrobat closes file

2006-05-28 Thread wren ng thornton
--- Chris Devers wrote: > Really?? > > In my experience, the `open` command immediately > returns control to the controlling process (the shell, > or whatever else invoked it (pine etc)) without > waiting for the `open`ed application to finish, or for > that matter even to finish launching. Othe

Re: Waiting until Acrobat closes file

2006-05-28 Thread Joel Rees
Except, of course, this is Unix, and we have i-nodes, and the system knows how to hold onto a file until all links are gone, as I recall. Ergo, just delete it once you know the viewer has it open, IIRC. There is only one way to be sure it is _your_ child process that has opened it. I'm pretty

Re: Waiting until Acrobat closes file

2006-05-28 Thread David Cantrell
Joel Rees wrote: Except, of course, this is Unix, and we have i-nodes, and the system knows how to hold onto a file until all links are gone, as I recall. Ergo, just delete it once you know the viewer has it open, IIRC. Which is fine, but if you use 'open' to fork off and run Acrobat in par

Re: Waiting until Acrobat closes file

2006-05-28 Thread David Cantrell
Chris Devers wrote: On Sun, 28 May 2006, David Cantrell wrote: if instead you're doing something like ... system('open', '/Applications/Acrobat.app'); then you'll need to: wait around until Acrobat appears in the process table; wait around until that PID disappears; Really?? In my experienc

Re: Waiting until Acrobat closes file

2006-05-28 Thread Christian Huldt
28 maj 2006 kl. 02.47 skrev Chris Devers: On Sun, 28 May 2006, David Cantrell wrote: if instead you're doing something like ... system('open', '/Applications/Acrobat.app'); then you'll need to: wait around until Acrobat appears in the process table; wait around until that PID disappear

Re: Waiting until Acrobat closes file

2006-05-27 Thread Joel Rees
if instead you're doing something like ... system('open', '/Applications/Acrobat.app'); then you'll need to: wait around until Acrobat appears in the process table; wait around until that PID disappears; Really?? In my experience, the `open` command immediately returns control to the con

Re: Waiting until Acrobat closes file

2006-05-27 Thread Chris Devers
On Sun, 28 May 2006, David Cantrell wrote: > if instead you're doing something like ... > > system('open', '/Applications/Acrobat.app'); > > then you'll need to: > > wait around until Acrobat appears in the process table; > wait around until that PID disappears; Really?? In my experience,

Re: Waiting until Acrobat closes file

2006-05-27 Thread David Cantrell
On Sun, May 28, 2006 at 12:27:02AM +0200, Tommy Nordgren wrote: > My perl script generates pdf files, and opens them with Acrobat. > How can I wait until Acrobat closes the file, so I can delete it? system('acroread', 'myfile.pdf'); unlink('myfile.pdf'); if instead you're doing something

Waiting until Acrobat closes file

2006-05-27 Thread Tommy Nordgren
My perl script generates pdf files, and opens them with Acrobat. How can I wait until Acrobat closes the file, so I can delete it? -- "Home is not where you are born, but where your heart finds peace" - Tommy Nordgren, "The dying old crone" [EMAI