From: Robert Klemme Date: 2006-05-06T15:03:26+09:00 Subject: Re: Generate unique filenames 2006/5/1, Paul Knight : > On May 1, 2006, at 10:33 AM, 13 wrote: > > > Hi, > > > > [snipping all around] > > > > I rather choose some self made random number based solution. > > > > -- > > Martins > > > > Rather than trying to setup a random number based solution, how about > using the fairly common (on *nix) uuidgen program? > > Regarding Tempfile, empty files are usually fairly cheap. I think the > guarantee that your file will be available is definitely something to > consider. Other advantages: - tempfile ships with every ruby install - tempfiles are guaranteed to be removed on process termination - if you are going to need it anyway, you can as well create it directly, remember, you can control the point in time when the tempfile instance is created and thus when the file will be created - tempfile is for "free" while you'll have to maintain every homegrown solution Cheers robert -- Have a look: http://www.flickr.com/photos/fussel-foto/