summaryrefslogtreecommitdiff
path: root/tar/bsdtar.1
diff options
context:
space:
mode:
Diffstat (limited to 'tar/bsdtar.1')
-rw-r--r--tar/bsdtar.127
1 files changed, 27 insertions, 0 deletions
diff --git a/tar/bsdtar.1 b/tar/bsdtar.1
index 04b56553..723ea38f 100644
--- a/tar/bsdtar.1
+++ b/tar/bsdtar.1
@@ -469,6 +469,13 @@ This is the reverse of
and the default behavior if
.Nm
is run as non-root in x mode.
+.It Fl Fl no-safe-writes
+(x mode only)
+Do not create temporary files and use
+.Xr rename 2
+to replace the original ones.
+This is the reverse of
+.Fl Fl safe-writes .
.It Fl Fl no-same-owner
(x mode only)
Do not extract owner and group IDs.
@@ -756,6 +763,26 @@ The default is
.Ar hrs
which applies substitutions to all names.
In particular, it is never necessary to specify h, r, or s.
+.It Fl Fl safe-writes
+(x mode only)
+Extract files atomically.
+By default
+.Nm
+unlinks the original file with the same name as the extracted file (if it
+exists), and then creates it immediately under the same name and writes to
+it.
+For a short period of time, applications trying to access the file might
+not find it, or see incomplete results.
+If
+.Fl Fl safe-writes
+is enabled,
+.Nm
+first creates a unique temporary file, then writes the new contents to
+the temporary file, and finally renames the temporary file to its final
+name atomically using
+.Xr rename 2 .
+This guarantees that an application accessing the file, will either see
+the old contents or the new contents at all times.
.It Fl Fl same-owner
(x mode only)
Extract owner and group IDs.