glogg icon indicating copy to clipboard operation
glogg copied to clipboard

Feature Request: Support reading gzipped files

Open nickman opened this issue 8 years ago • 7 comments

GZip encoding can be detected on file open. I realize this may be a performance hit, but it would be extremely helpful.

nickman avatar Aug 04 '16 15:08 nickman

I'd like this for all archive files because in our company logs are attached to bug-reports as zip/7z archives and having to unpack them before opening is pain :) However, I don't see how this can be achived using current line indexing.

variar avatar Dec 02 '16 16:12 variar

Indeed, this is highly desirable and I have been thinking about how to do that for a while. Indexing is fine as you can stream the file whilst indexing. The problem is the display, which is done by reading a small, arbitrary part of the file, this is difficult to do on a compressed file unless the compressor as put some marking in it. But I'm still trying to find a solution (which is not to decompress the file fully in memory!!)

nickbnf avatar Mar 17 '17 17:03 nickbnf

Might I suggest this interface: You are a viewing a compressed file, would you like to decompress it? NOTE: This will disable realtime-streaming of this file, and will decompress in a temporary directory [Decompress]

If you push decompress, do nothing fancy other than unzip to tmp & open that in a new tab (Then popup an error if the tempdir write fails)

Then all these concerns about random access and performance is sidestepped in favor of a one-click, sensible interface. Besides, realtime streaming is rarely needed for compressed files, they are usually archives.

Yes this will use disk space, but since it's by user request, it seems reasonable

jleaders avatar Jun 07 '19 18:06 jleaders

I would also vote for decompressing on the fly to a (configurable) temporary directory.

On Linux lograte often times produces gzipped log files (no archive, just gzipped) - I think that's the reason zless / zgrep exist ;)

svogt avatar Dec 03 '19 12:12 svogt

Integrated to latest pre-release klogg build (20.1.0.562, see CI artifacts) a simple version of @jleaders suggestion. zip/7zip/tar.gz/tar.bz2/tar.xz are supported as well as gz/bz2/xz compressed files. Compression is determined by extension. Will use something like libmagic to actually look into file headers in next builds.

Would appreciate any feedback.

variar avatar Jan 03 '20 09:01 variar

Thanks for your great work! Any hope for it merging down into glogg?

jleaders avatar Jan 04 '20 00:01 jleaders

There has been no activity in glogg repository since April 2018 :( That is one of the reasons my fork exists.

If @nickbnf is still interested in developing glogg, I will be happy to contribute. If not then finding new maintainer for this great peace of software might be an option.

variar avatar Jan 04 '20 07:01 variar