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 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;

Check out Mac::Processes on the CPAN.

-- 
David Cantrell | random organic glop and a metric fuckton of electricity

    Wow, my first sigquoting! I feel so special now!
        -- Dan Sugalski

Reply via email to