summaryrefslogtreecommitdiff
path: root/src/copy.h
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2001-10-13 19:36:26 +0000
committerJim Meyering <jim@meyering.net>2001-10-13 19:36:26 +0000
commit95cc4c0984e8ef052afd4304086a406917deedd7 (patch)
tree5569f8329dad3be7d551f217c16417ed5af02dd0 /src/copy.h
parentef549ef73e0e28c69d27f056cf29e92b56234292 (diff)
downloadcoreutils-95cc4c0984e8ef052afd4304086a406917deedd7.tar.xz
(enum Dereference_symlink): Add comments.
(struct cp_options) [preserve_links]: New member.
Diffstat (limited to 'src/copy.h')
-rw-r--r--src/copy.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/copy.h b/src/copy.h
index a2bd02644..6b949d048 100644
--- a/src/copy.h
+++ b/src/copy.h
@@ -31,12 +31,20 @@ enum Interactive
I_UNSPECIFIED
};
+/* How to handle symbolic links. */
enum Dereference_symlink
{
DEREF_UNDEFINED = 1,
- DEREF_ALWAYS,
+
+ /* Copy the symbolic link itself. -P */
DEREF_NEVER,
- DEREF_COMMAND_LINE_ARGUMENTS
+
+ /* If the symbolic is a command line argument, then copy
+ its referent. Otherwise, copy the symbolic link itself. -H */
+ DEREF_COMMAND_LINE_ARGUMENTS,
+
+ /* Copy the referent of the symbolic link. -L */
+ DEREF_ALWAYS
};
# define VALID_SPARSE_MODE(Mode) \
@@ -52,7 +60,7 @@ struct cp_options
them, symbolic links,) as if they were regular files. */
int copy_as_regular;
- /* If nonzero, dereference symbolic links (copy the files they point to). */
+ /* How to handle symlinks. */
enum Dereference_symlink dereference;
/* If nonzero, remove each existing destination nondirectory before
@@ -92,6 +100,18 @@ struct cp_options
int preserve_mode;
int preserve_timestamps;
+ /* Enabled for mv, and for cp by the --preserve=links option.
+ If nonzero, attempt to preserve in the destination files any
+ logical hard links between the source files. If used with cp's
+ --no-dereference option, and copying two hard-linked files,
+ the two corresponding destination files will also be hard linked.
+
+ If used with cp's --dereference (-L) option, then, as that option implies,
+ hard links are *not* preserved. However, when copying a file F and
+ a symlink S to F, the resulting S and F in the destination directory
+ will be hard links to the same file (a copy of F). */
+ int preserve_links;
+
/* If nonzero and any of the above (for preserve) file attributes cannot
be applied to a destination file, treat it as a failure and return
nonzero immediately. E.g. cp -p requires this be nonzero, mv requires