in reply to Re: File::Temp randomness when forking
in thread File::Temp randomness when forking
Your method will fail to generate a unique name if you are creating more than one file per process per second (which can happen easy enough), or even if you're on a system that does not handle PIDs sanely. File::Temp exists exactly because it is very easy to fall into this kind of trap and surprisingly hard to avoid all traps that come with temporary file generation. "Millions of systems the world over" do this badly and sometimes fail because their author did not consider all corner cases (especially since such errors tend to show up only on loaded production systems and not during testing). Using File::Temp for temporary files is definitely a best practice in my book and there would have to be very specific reasons for recommending against it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: File::Temp randomness when forking
by ryantate (Friar) on Nov 29, 2005 at 18:03 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |