summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-02-02 00:09:25 +0000
committerJim Meyering <jim@meyering.net>1997-02-02 00:09:25 +0000
commit3cca84e543eee9c160c3f84ceaaf1feb2e9c3498 (patch)
tree41492dea86ebd5958db41e858c6d6701c220cf8c /src
parent4ea19e3b3177769b709cd1cef854d09fb1e782c0 (diff)
downloadcoreutils-3cca84e543eee9c160c3f84ceaaf1feb2e9c3498.tar.xz
.
Diffstat (limited to 'src')
-rw-r--r--src/copy.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/src/copy.h b/src/copy.h
new file mode 100644
index 000000000..9199c776b
--- /dev/null
+++ b/src/copy.h
@@ -0,0 +1,86 @@
+#ifndef COPY_H
+# define COPY_H
+
+/* Control creation of sparse files (files with holes). */
+enum Sparse_type
+{
+ SPARSE_UNUSED,
+
+ /* Never create holes in DEST. */
+ SPARSE_NEVER,
+
+ /* This is the default. Use a crude (and sometimes inaccurate)
+ heuristic to determine if SOURCE has holes. If so, try to create
+ holes in DEST. */
+ SPARSE_AUTO,
+
+ /* For every sufficiently long sequence of bytes in SOURCE, try to
+ create a corresponding hole in DEST. There is a performance penalty
+ here because CP has to search for holes in SRC. But if the holes are
+ big enough, that penalty can be offset by the decrease in the amount
+ of data written to disk. */
+ SPARSE_ALWAYS
+};
+
+struct cp_options
+{
+ /* If nonzero, copy all files except (directories and, if not dereferencing
+ them, symbolic links,) as if they were regular files. */
+ int copy_as_regular;
+
+ /* If nonzero, dereference symbolic links (copy the files they point to). */
+ int dereference;
+
+ /* If nonzero, remove existing destination nondirectories. */
+ int force;
+
+ /* If nonzero, create hard links instead of copying files.
+ Create destination directories as usual. */
+ int hard_link;
+
+ /* If nonzero, query before overwriting existing destinations
+ with regular files. */
+ int interactive;
+
+ /* If nonzero, when copying recursively, skip any subdirectories that are
+ on different filesystems from the one we started on. */
+ int one_file_system;
+
+ /* If nonzero, give the copies the original files' permissions,
+ ownership, and timestamps. */
+ int preserve;
+
+ /* If nonzero, copy directories recursively and copy special files
+ as themselves rather than copying their contents. */
+ int recursive;
+
+ /* Control creation of sparse files. */
+ enum Sparse_type sparse_mode;
+
+ /* If nonzero, create symbolic links instead of copying files.
+ Create destination directories as usual. */
+ int symbolic_link;
+
+ /* The bits to preserve in created files' modes. */
+ int umask_kill;
+
+ /* If nonzero, do not copy a nondirectory that has an existing destination
+ with the same or newer modification time. */
+ int update;
+
+ /* If nonzero, display the names of the files before copying them. */
+ int verbose;
+
+ /* This process's effective user ID. */
+ uid_t myeuid;
+
+ /* A pointer to either lstat or stat, depending on
+ whether the copy should dereference symlinks. */
+ int (*xstat) ();
+};
+
+int
+copy __P ((const char *src_path, const char *dst_path,
+ int nonexistent_dst, const struct cp_options *options));
+
+#endif