#198·snappy

extension checking is too strict

Author: jheidemannCreated Mar 8, 2025Updated Mar 8, 2025

I was surprised dropping snzip in with other compressors that it enforces filename extensions.

Thus:

echo foo | snzip -c >foo.sz; snzcat foo.sz

works. But

echo foo | snzip -c >foo.sz; mv foo.sz foo.sz~; snzcat foo.sz~

fails with error "foo.sz~ has unknown suffix". However

snzcat <foo.sz~

will work fine, because it hides the filename from snzcat.

This behavior is stricter than gzip and xz, and it makes it hard to use snzip as a drop-in.

Perhaps a -f option could force compression, even if the filename is unrecognized?