le has asked for the wisdom of the Perl Monks concerning the following question:
Hi folks,
I'm looking for a module or some other algorithm, that can generate unique filenames (and maybe returns the filehandle).
I'm currently working on a web app, that writes a file into a directory. The problem is, that the filenames should be unique, so if the script attempts to create two files at the same time the files don't clobber.
I hope you get what I mean, something like "I need a new file, and I think the filename 99887766 is ok, but if there's already 99887766, give me 99887767."
I'm looking for a module or some other algorithm, that can generate unique filenames (and maybe returns the filehandle).
I'm currently working on a web app, that writes a file into a directory. The problem is, that the filenames should be unique, so if the script attempts to create two files at the same time the files don't clobber.
I hope you get what I mean, something like "I need a new file, and I think the filename 99887766 is ok, but if there's already 99887766, give me 99887767."
Back to
Seekers of Perl Wisdom