Meaning of "almost atomic" transfer using temporary files?

I read the "SCP command man page" on linux, at the end I said:

"With an" almost atomic "transfer using temporary files, no attempts are made."

Vaguely I can guess what it is, but can anyone clearly tell me the technical definition of this proposal.

Thank you paddy

+7
source share
2 answers

Atomic would mean that nothing else could read or write the file until scp finished with it. "Near-atomic" refers to the usual practice of copying a file to a temporary location (on the target machine / disk) and then moving it to the final location. The move operation is much faster than the copy ("almost atomic"), but it is not necessarily atomic in the true sense of the word. Another process could still read the file in an inconsistent state during a non-atomic move.

+4
source

The atomic copy will have Craig status, use a temporary file, and then a temporary mv file for the intended destination. Mv IS - the source and destination of the atom, located in one section. Only files with the tmp file open will be readable. rename () is not atomic in files that move between partitions since data needs to be copied.

This assumes that you are of course browsing the UNIX system :)

+5
source

All Articles