bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tar --create --auto-compress should warn on unrecognized suffix


From: Philip Rowlands
Subject: tar --create --auto-compress should warn on unrecognized suffix
Date: Tue, 09 Jan 2024 18:52:05 +0000
User-agent: Cyrus-JMAP/3.9.0-alpha0-1364-ga51d5fd3b7-fm-20231219.001-ga51d5fd3

I'm using GNU tar 1.30 from an RHEL-derived distro, which doesn't know about 
--zstd.

This is not a bug, however when I try to create archive.tar.zst there is no 
clue that it didn't work. tar 1.30 silently creates uncompressed output.

Specifically, if the newly created filename is unknown to 
suffix.c::find_compression_suffix then no compression is applied and no warning 
emitted.

I appreciate for --extract --auto-compress that such a warning could be 
considered noise, but when using --create for a brand new archive it would be 
helpful to tell the user that the suffix is unrecognised.


Steps to repro:

$ tar --version
tar (GNU tar) 1.30

$ tar cfva test.tar.zst t*.c
tar.c
transform.c

$ file test.tar.zst
test.tar.zst: POSIX tar archive (GNU)


Expected output:

$ tar cfva test.tar.zst t*.c
tar: Unknown auto-compress suffix "zst", proceeding with no compression
tar.c
transform.c



Cheers,
Phil



reply via email to

[Prev in Thread] Current Thread [Next in Thread]