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

Home » Public Forums » archive » Re: Create unique temporary file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Create unique temporary file [message #40789 is a reply to message #40674] Wed, 25 August 2004 17:10 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Michael Wallace <mwallace.no.spam@no.spam.swri.edu.invalid> writes:

>> Here is how I create a unique journal file name:
>>
>> Print, String('journal_', Bin_Date(SysTime()), '.pro', $
>> Format='(A, I4, 5I2.2, A)')
>
> Thanks for the idea. I had thought of using a current system time
> stamp, but it totally slipped my mind that I could concatenate the
> number together so easily. It's little details like that which I'm
> still learning. When I finally wrote my code, not only did I take the
> date as you did, but I further appended a random number and I did a
> check of file existence to ensure that nothing would ever get clobbered.
> The only way this could fail would be if there were some insane
> once-in-a-lifetime freakish occurrence. Now that I've said this, this
> will happen tomorrow. ;-)

Hey Michael, I'm coming into this late, but I've developed a function
called CMUNIQUE_ID() which generates unique identifiers. I use it all
the time to avoid name clashes. I bases the unique ID on the time,
some randomness, and any other bits you can throw at it. Each time you
ask for another ID, you get a different one. [ It works even if you
ask for two IDs within the same second, which might not work if one
uses SYSTIME() alone. ]

Good luck,
Craig

http://cow.physics.wisc.edu/~craigm/idl/idl.html (under Misc.)

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Another EPS question
Next Topic: Create unique temporary file

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

Current Time: Sun Nov 30 10:13:08 PST 2025

Total time taken to generate the page: 3.53029 seconds