In Emacs, when you open compressed file like
foo.txt.gz, it will transparently decompress it (using
gzip in case above) and open as normal file. However, what will happen if above file is not compressed at all?
However, application that would ship logs to S3, would ship them with gzip extension attached (hence foo.txt.gz), but files would not be compressed. I'm not sure if this behavior is intentional or bug in the script, but this will cause Emacs to fail with this error:
Error while executing "gzip -c -q -d < foo.txt.gz" gzip: stdin: not in gzip format
vim will fail as well, but
less will open it correctly because it looks in file header, not extension.
Emacs has find-file-literally for cases like this - it will open file as is without applying any kind of conversion. Usually first choice and excellent tool for debugging malformed content.
But, other modes like
dired or VLF will not work, because they are using
find-file for opening files, and this function will try to apply all conversion magic usually we get when Emacs opens a file.
What worked in my case is this: I disabled auto-compression-mode, which is enabled by default, calling
M-x auto-compression-mode. And suddenly dired and VLF, start openning those files without problems.
Just to remind you to not forget to enable auto-compression-mode again or reading links from Emacs documentation (e.g.
M-x describe-function), maybe even other stuff, will silently stop working ;)