Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Temporary text files with File::Temp

by adamk (Chaplain)
on Feb 27, 2008 at 05:55 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://670497]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found