Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re: Is it possible to generate unique temporary filenames using hostname/process id?

by iguanodon (Curate)
on Mar 14, 2004 at 01:29 UTC ( #336439=note: print w/ replies, xml ) Need Help??


in reply to Re: Is it possible to generate unique temporary filenames using hostname/process id?
in thread Is it possible to generate unique temporary filenames using hostname/process id?

Ok, I know I run the risk of looking like a dumbass here but (assuming a Unix platform) what's wrong with $$ . time()? Is the risk that so many processes are created within one second that the PIDs roll over?


Comment on Re: Re: Is it possible to generate unique temporary filenames using hostname/process id?
Download Code
Re: Is it possible to generate unique temporary filenames using hostname/process id?
by bill_mcgonigle (Acolyte) on Mar 15, 2004 at 02:34 UTC
    Stick a long random number on the end and your odds are pretty good. Of course, there's no reason not to look for a name collision to guarantee it.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://336439]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2015-07-06 16:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (77 votes), past polls