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
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.
If you're going to use acroread, then [a] you have to install it, and
[b] you have to view the document in X11. Yuck. Surely that isn't
really
the best way to approach this, is it? I'd have thought that the `open`
command was the perfect answer to this question...
system('open', '/Applications/Preview.app');
Well, I think the orginal problem was waiting until the viewer closed
the document to delete the file. So, whichever viewer you use (X11
acrobat reader, Mac OS X acrobat reader, preview app, something else)
you're still stuck with the problem of how to avoid deleting a file out
from under the viewer.
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.