summaryrefslogtreecommitdiff
path: root/src/copy.c
AgeCommit message (Collapse)Author
2000-07-15Convert "`%s'" in format strings to "%s", and wrap eachJim Meyering
corresponding argument in a `quote (...)' call -- if there's only one. If there are more than one, then use `quote_n (0, ...), quote_n (1, ...), ...'.
2000-06-27(copy_dir): Don't set errno beforeJim Meyering
invoking savedir, and assume that errno is nonzero if savedir fails.
2000-06-25(copy_internal): Don't return return immediately after aJim Meyering
failed copy_dir call -- otherwise, the failure to read a single file in a source directory would cause the containing destination directory not to have owner/perms set properly. Reported by Piotr Kwapulinski.
2000-06-16(copy_reg): Give a slightly better diagnostic.Jim Meyering
2000-05-29Allow `cp -d -u' to copy one symlink onto another that's identical.Jim Meyering
(copy_internal): Change the || to ^ in the big sameness test, so copying one symlink onto another, identical one doesn't fail here. If the symlink call fails, don't report the failure if the destination already exists and is a symlink pointing to the proper name.
2000-05-12(copy_internal): Fix force and interactive tests.Jim Meyering
2000-02-05(copy_internal): Don't allow mv to move a directory ontoJim Meyering
a non-directory. Reported by Brian Kimball via Michael Stone.
2000-01-09This affects cp, install, and mv.Jim Meyering
(copy_internal): When making backup files in verbose mode, print the backup file name on the same line as the rest of the information, e.g., `a -> b (backup: b.~13~)' rather than on a line by itself.
1999-12-05Revert the previous change.Jim Meyering
(copy_internal): In move mode, if the rename attempt fails, then unlink any existing destination file. This makes a cross-device `mv' more consistent with the intra-device behavior. This change is required by POSIX to make a cross-device move act with semantics similar to those of the rename syscall. For example now `mv' can move a file onto a symlink to itself when that symlink is on a separate partition. With fileutils-4.0j, it would fail with a diagnostic saying they were the same file. Reported by Bruno Haible.
1999-12-04(copy_internal): Be consistent with intra-device behaviorJim Meyering
and *do* allow `mv' to move a file onto a symlink to itself when that symlink is on a separate partition. With fileutils-4.0j, it would fail with a diagnostic saying they were the same file. Reported by Bruno Haible.
1999-11-11(copy_internal): Treat src and dest as the `same' inJim Meyering
`mv src symlink-to-src' when src and dest are on different partitions. Otherwise, that `mv' command would silently remove `src'. Reported by Michael Stone.
1999-11-05Use HAVE_STRUCT_STAT_ST_BLOCKS, not deprecated HAVE_ST_BLOCKS.Jim Meyering
1999-08-08(copy_dir): Remove cast of savedir arg.Jim Meyering
1999-05-23(copy_internal): Don't apply the umask in move_mode.Jim Meyering
Otherwise, `mv' would not preserve the permissions when copying between partitions. Reported by David Godfrey
1999-05-23Remove today's earlier misguided attempts.Jim Meyering
Add a single condition to the existing sameness test.
1999-05-23Include same.h.Jim Meyering
(copy_internal): Qualify SAME_INODE test with (link-count == 1 || same_name(...)).
1999-05-23(copy_internal): Make it so `mv -f FILE FILE' does not remove FILE.Jim Meyering
Based on a patch from Chris Yeo.
1999-04-30(copy_internal): Move the one-file-system test so thatJim Meyering
it follows the `if (new_dst || !S_ISDIR (dst_sb.st_mode))' block. Prior to this change, `cp --one-file-system' would traverse a file- system boundary if the destination directory existed. From thospel@mail.dma.be.
1999-04-30(copy_internal): Don't make `mv foo symlink-to-foo' fail.Jim Meyering
That is, even though source and destination are `the same,' don't fail if the destination is a symlink. From Peter Samuelson.
1999-04-26(copy_reg, copy_internal): Use proper mode_t types and macros.Jim Meyering
Don't assume the traditional Unix values for mode bits.
1999-02-16update copyright datesJim Meyering
1999-01-31(copy_internal): Describe any backup-related renamingJim Meyering
operations when in verbose mode. (copy_internal): Likewise. Based on changes from Marty Leisner.
1999-01-11(copy_internal): Handle two more values of errno fromJim Meyering
failed rename of a directory into a subdirectory of itself.
1998-12-18(copy_internal): Remove errnoeous `%s: ' prefixJim Meyering
from format string. From Michiel Bacchiani.
1998-12-07Use dir_name, not dirname. Include dirname.h.Jim Meyering
1998-11-30(copy_internal): Remove earlier (but less effective)Jim Meyering
test for move/copy-into-self. Instead, deduce the move-into-self condition from errno==EINVAL after a failed rename.
1998-09-28(copy_internal): Do honor `n' reply in move-mode.Jim Meyering
Otherwise, `touch a b; echo n|mv -i a b' would remove b. From Bernd Leibing.
1998-09-27(copy_internal): Don't preserve hard-linked directoriesJim Meyering
to avoid damaging the destination filesystem when copying from a Netapp snapshot directory. With code from Kjetil Torgrim Hollstein and Paul Eggert.
1998-08-15(copy_internal) [one-file-system]: Do copy mount pointJim Meyering
directories (but none of their entries). This makes `cp --one-file-system' work the same way tar does. From Marty Leisner.
1998-08-02(copy_internal): Compare time stamps with subsecond resolution if available.Jim Meyering
1998-07-25(SAME_INODE): Remove definition.Jim Meyering
1998-07-19(copy_internal): Add another exclusion from theJim Meyering
sameness test: when --force has been specified, the destination is unlinked before any copy. (copy_internal): Add yet another: when both src and dest are symlinks.
1998-07-03(copy_internal): Rename variable and reverse sense of testsJim Meyering
to make the code a little clearer.
1998-07-03(SAME_INODE): New macro.Jim Meyering
Use it to replace open-coded equivalents.
1998-07-03(copy_internal): Try harder identifying a relativeJim Meyering
symbolic link in the current directory. From Andreas Schwab.
1998-07-03(copy_internal): Don't skip test for same file if creating a hardlinkJim Meyering
from symlink over a non-symlink while making backups.
1998-07-03(copy_internal): Don't call chown on a symlink.Jim Meyering
1998-06-27(copy_internal): Fix it so hard-link test is no longer hidden insideJim Meyering
big if-(backup_type == none) block.
1998-06-27(copy_reg): Detect identical source and dest here.Jim Meyering
(copy_internal): Make the test symmetric.
1998-05-13(copy_internal): Plug a small leak.Jim Meyering
1998-05-11(copy_internal): Use new move_mode member.Jim Meyering
Add parameter. (copy): Add parameter.
1998-05-10(new_nondir_mode): New function. Use where appropriate.Jim Meyering
Use more-specific preserve_* members in place of removed `preserve'. (copy_internal): Honor failed_unlink_is_fatal.
1998-03-28Add copyright.Jim Meyering
1998-03-15Use #if, not #ifdef with HAVE_ macros.Jim Meyering
Use #if !, not #ifndef with HAVE_ macros.
1998-03-13(copy_dir): Add new parameter, copy_into_self, and set it.Jim Meyering
(copy_internal): Likewise. (copy): Likewise. Update all callers.
1998-01-25(DO_CHOWN): Don't fail for non-root when chown fails dueJim Meyering
not only to lack of permission (EPERM), but also to lack of support (EINVAL). Reported by Bengt Martensson.
1998-01-22(copy_internal): Use x->backup_type, not the global.Jim Meyering
(valid_options): Use VALID_BACKUP_TYPE and VALID_SPARSE_MODE.
1997-12-25(copy_internal): Use S_ISLNK only if defined.Jim Meyering
1997-12-16s/__P/PARAMS/gJim Meyering
1997-11-30(copy_reg): Store file size as off_t, not long.Jim Meyering
Do not assume st_size has been normalized to 512 byte blocks, or that it fits in size_t after dividing by the blocksize.