hello everybody,
i'm just asking myself wether perl's "rename"-function is atomic.
what i mean is the following:
if i update a file 'orig.txt', say i append some lines to it, i'm used
to first copy this file to a temporary file 'tmp.txt', then append the
lines to 'tmp.txt', then use the following perl-code
rename 'tmp.txt','orig.txt';
i do this in order to increase security. if the program or the
computer crashes
while writing, the original file is not lost.
but what if it crashes during 'rename'?
is 'rename' atomic in the sense that it is either carried out
completely or not all all?
greeting from germany,
joachim