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."
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: "unique" filename?
by quidity (Pilgrim) on Dec 03, 2000 at 22:22 UTC | |
Re: "unique" filename?
by Fastolfe (Vicar) on Dec 03, 2000 at 22:17 UTC | |
Re: "unique" filename?
by 2501 (Pilgrim) on Dec 04, 2000 at 01:05 UTC | |
by myocom (Deacon) on Dec 04, 2000 at 02:18 UTC | |
by 2501 (Pilgrim) on Dec 04, 2000 at 03:33 UTC | |
by quidity (Pilgrim) on Dec 04, 2000 at 05:12 UTC | |
by repson (Chaplain) on Dec 04, 2000 at 07:02 UTC | |
by merlyn (Sage) on Dec 04, 2000 at 05:14 UTC | |
Re: "unique" filename?
by the_slycer (Chaplain) on Dec 04, 2000 at 21:01 UTC | |
Re: "unique" filename?
by tune (Curate) on Dec 04, 2000 at 05:18 UTC | |
by merlyn (Sage) on Dec 04, 2000 at 05:21 UTC | |
by tune (Curate) on Dec 05, 2000 at 04:16 UTC | |
by merlyn (Sage) on Dec 05, 2000 at 04:25 UTC |
Back to
Seekers of Perl Wisdom