comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Create unique temporary file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Create unique temporary file [message #40677] Tue, 24 August 2004 21:45 Go to next message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
I need some robust way to create a temporary file. The filepath
function will get you part of the way toward this goal since it can
prepend your system's temporary directory to the file name. But you
still have to come up with a good filename.

filename = FilePath('myfile.txt', /TMP)

The above command will do the job if you only have one copy of the
program running. If there are two or more copies of the program
running, or even a single program running in multiple threads, there's a
possibility of collision when two processes or two threads attempt to
use the same temporary filename at the same time.

What I'd like is some way to generate a completely unique filename
except for the extension to reduce the probability of a collision. Any
bright ideas?

-Mike
Re: Create unique temporary file [message #40788 is a reply to message #40677] Wed, 25 August 2004 17:34 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Craig Markwardt writes:

> Hey Michael, I'm coming into this late, but I've developed a function
> called CMUNIQUE_ID() which generates unique identifiers.

I spend half the day thinking what a genius programmer
I am (new Annotate capability in my Catalyst Library),
and half the day wondering if anyone will figure out
I don't know beans about programming. :-(

Cheers,

David

P.S. Let's just say *this* is a damn random sequence! :-)

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Create unique temporary file
Next Topic: save an IDLanROI to file? (newbie question)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 11:51:18 PDT 2025

Total time taken to generate the page: 0.00330 seconds