Subject: Re: bug#29317: info shred:documentation feedback

From: Pádraig Brady <[email-masked]>
Date: Sat, 9 Dec 2017 16:56:10 -0800

On 16/11/17 03:38, kalle wrote:
> hello,
> 
> - at the sentence "by default does not truncate": what does truncating a
> file means? Could this be described better in the manual?
> -part "on a busy system": why is this written here? Is this a usual
> method to overwrite content?

truncate deallocates data.
remove deletes the reference to the data.

I suppose truncate is to deallocate, as unlink is to remove,
so the attached uses 'deallocate' instead of 'truncate'.

cheers,
Pádraig
From 6150b10698a4c3757630aba76720e7262d0590bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email-masked]>
Date: Sat, 9 Dec 2017 16:49:45 -0800
Subject: [PATCH] doc: shred: change 'truncate' to the more descriptive
 'deallocate'

* doc/coreutils.texi (shred invocation): s/truncate/deallocate/.
* src/shred.c (usage): Likewise.
Fixes https://bugs.gnu.org/29317
---
 doc/coreutils.texi | 6 +++---
 src/shred.c        | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index ed3a633..bd766e4 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -9958,8 +9958,8 @@ destroy it.
 @command{shred} makes no attempt to detect or report this problem, just as
 it makes no attempt to do anything about backups.  However, since it is
 more reliable to shred devices than files, @command{shred} by default does
-not truncate or remove the output file.  This default is more suitable
-for devices, which typically cannot be truncated and should not be
+not deallocate or remove the output file.  This default is more suitable
+for devices, which typically cannot be deallocated and should not be
 removed.
 
 Finally, consider the risk of backups and mirrors.
@@ -10016,7 +10016,7 @@ the whole file.  @var{bytes} can be followed by a size specification like
 @opindex --remove=wipe
 @opindex --remove=wipesync
 @cindex removing files after shredding
-After shredding a file, truncate it (if possible) and then remove it.
+After shredding a file, deallocate it (if possible) and then remove it.
 If a file has multiple links, only the named links will be removed.
 Often the file name is less sensitive than the file data, in which case
 the optional @var{how} parameter, supported with the long form option,
diff --git a/src/shred.c b/src/shred.c
index f2b5d27..b1f0b64 100644
--- a/src/shred.c
+++ b/src/shred.c
@@ -186,7 +186,7 @@ If FILE is -, shred standard output.\n\
   -s, --size=N   shred this many bytes (suffixes like K, M, G accepted)\n\
 "), DEFAULT_PASSES);
       fputs (_("\
-  -u             truncate and remove file after overwriting\n\
+  -u             deallocate and remove file after overwriting\n\
       --remove[=HOW]  like -u but give control on HOW to delete;  See below\n\
   -v, --verbose  show progress\n\
   -x, --exact    do not round file sizes up to the next full block;\n\
-- 
2.9.3