Preserve the metadata of input files
sorairolake opened this issue · comments
Other commands such as gzip
and zstd
preserve the metadata (permissions, mtime, etc.) of input files (original files), but bzip3
does not seem to do so. Like other commands, I think it is desirable for bzip3
to preserve as much of the metadata of input files as possible.
$ bzip3 -V
bzip3 1.4.0
Copyright (C) by Kamila Szewczyk, 2022-2023.
License: GNU Lesser GPL version 3 <https://www.gnu.org/licenses/lgpl-3.0.en.html>
$ eza -lg bz3cat*
.r--r--r-- 40 1000 100 10 Jan 00:20 bz3cat
.r--r--r-- 16 1000 100 10 Jan 00:20 bz3cat.1
$ gzip bz3cat ; bzip3 bz3cat.1 && rm bz3cat.1
$ eza -lg bz3cat*
.rw-r--r-- 41 root root 10 Jan 10:24 bz3cat.1.bz3
.r--r--r-- 67 1000 100 10 Jan 00:20 bz3cat.gz
$ chmod -w bz3cat.1.bz3 && eza -lg bz3cat*
.r--r--r-- 41 root root 10 Jan 10:24 bz3cat.1.bz3
.r--r--r-- 67 1000 100 10 Jan 00:20 bz3cat.gz
$ gunzip bz3cat.gz ; bunzip3 bz3cat.1.bz3 && rm bz3cat.1.bz3
$ eza -lg bz3cat*
.r--r--r-- 40 1000 100 10 Jan 00:20 bz3cat
.rw-r--r-- 16 root root 10 Jan 10:26 bz3cat.1
See also: facebook/zstd#3432
Agreed, I will look into it.