cpdup - Do not create a .tmp file and rename if the target does not exist.
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 21 Jun 2009 02:25:26 +0000 (19:25 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 21 Jun 2009 02:25:26 +0000 (19:25 -0700)
commit0e9fad5e47425d0753278b41e5169f5b8c50799d
treeba56d68c605e442f314a67e4cf46a0a0a828b980
parent39d8fd636004057de2f4039d0c527e8a5194fb08
cpdup - Do not create a .tmp file and rename if the target does not exist.

* When copying if the target does not exist use the target's actual name
  instead of the name of a temporary file.

  This helps filesystems (aka HAMMER) which use hashed directories.  Inode
  numbers can be selected by the FS on the basis of the file-name in
  order to maintain directory-order linearity.  If the copy program creates
  the target file with one name and then renames it to the real name,
  however, the feature is lost and we get one big scramble again.
bin/cpdup/cpdup.c