On Sun, Jul 27, 2008 at 10:40 PM, Eric Wilhelm <[EMAIL PROTECTED]> wrote: > # from James Keenan via RT > # on Sunday 27 July 2008 18:45: > >>> It appears that this test assumes (multiple times perhaps?) that it >>> may make named files in /tmp/. >> >>Are you saying that making named files in /tmp (or any other temporary >>directory) is bad or something to be avoided? If so, what >> alternatives should we pursue? > > Yes. At least, things like '/tmp/file' and '/tmp/dir' are asking for > trouble. By "named files", I mean "simplistically named". > > Firstly, as a matter of good practice: a simple name (especially short > things like 't') could conflict with a file or directory name which is > likely something I'm using (i.e. if I had a directory /tmp/t/, then the > test would have passed, but silently deleted some files I was working > with and made me sad - or at least extremely puzzled!) > > Secondly, for parallelization: you could conflict with another of your > own test scripts and then everyone gets confused and puzzled. > > Suggested alternative: create one directory such as "/tmp/parrot.7947" > (using process id or a more sophisticated algorithm if available), then > create whatever you want inside that -- "/tmp/parrot.7947/t" is fine. > > Thanks, > Eric > -- > We who cut mere stones must always be envisioning cathedrals. > --Quarry worker's creed > --------------------------------------------------- > http://scratchcomputing.com > --------------------------------------------------- >
Better yet, use File::Temp's tempdir to get a safe temporary directory. -- Will "Coke" Coleda