Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Temporary text files with File::Temp

by adamk (Chaplain)
on Feb 27, 2008 at 05:55 UTC ( #670497=note: print w/ replies, xml ) Need Help??


in reply to Temporary text files with File::Temp

As a small aside, on Unix at least the use of Temp::File-generated temp files is inappropriate if you are using it for the purpose of atomic overwrite.

The reason is that most of the time /tmp is not on the same partition as the file you want to overwrite, so the resulting system move command to move the file into place is not atomic, it has to copy the bitstream.

If you want atomic overwrite, you HAVE to write the initial file to somewhere on the same partition as the target, which generally means to the same directory.


Comment on Re: Temporary text files with File::Temp
Re^2: Temporary text files with File::Temp
by Anonymous Monk on Feb 27, 2008 at 06:15 UTC
    File::Temp allows you to write the temp file to any directory you choose. There is no requirement to have it end up in /tmp.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://670497]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2014-12-19 03:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (70 votes), past polls