[Thread Prev][Thread Next][Index]

process ID, collisions



Wondering if anyone's come up with a robust and collision-free way to
create temporary files in Ferret.  In particular, it'd be great to have a
way to obtain the process identification (PID) of the Ferret session. For
example, in shell scripting it's customary to create temporary files like

   /tmp/$com:tmp.$$

This way the temporary file is definitely (1) in a writeable directory,
(2) traceable to its calling script, (3) identified as a temporary file,
and (4) uniquely identified by its PID to avoid collisions with other
users running the same script.

I tried something like

  spawn echo $$

but this appears to echo the PID of the spawned subshell, not the parent
Ferret process.  Anybody know how to get hold of the Ferret PID?  I
suppose one could do it with a wrapper around the executable -- any other
ideas?

Thanks for your help,

Andrew

----------------------------------------------------------------------
Andrew Wittenberg          Program in Atmospheric and Oceanic Sciences
andyw@splash.princeton.edu                        Princeton University
----------------------------------------------------------------------



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement