Author Topic: gz File Reading  (Read 7338 times)

acg

  • Community Member
  • Posts: 13
  • Hero Points: 0
gz File Reading
« on: September 19, 2017, 01:58:16 PM »
"Support for reading .gz files without decompressing them first"

This right there is the reason I jumped on this beta today.  Unfortunately, I'm unable to get it working.  Is there anything I need to toggle on?  Or are there version limitations?

Thanks.

This is the version information for what we're using:

 gzip -V
gzip 1.4
Copyright (C) 2007 Free Software Foundation, Inc.
Copyright (C) 1993 Jean-loup Gailly.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: gz File Reading
« Reply #1 on: September 19, 2017, 04:48:32 PM »
Ah...  there's something non-obvious you need to do.

First, use the open tool window. If you have a file called test.gz. Type test.gz/test.  Then you can open the file. It treats it like a zip or tar file (like a directory).

I can't remember if we put in an option to auto crack open a .gz file. We will look into this.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: gz File Reading
« Reply #2 on: September 19, 2017, 06:27:46 PM »
When you do a multi-file find, you can check the "Look in zip/word/excel files" check box and it will also traverse .tar and .gz folders due to the way SlickEdit treats them as directories.

acg

  • Community Member
  • Posts: 13
  • Hero Points: 0
Re: gz File Reading
« Reply #3 on: September 19, 2017, 06:58:17 PM »
I'm opening the file via the FTP window (to our WAS hosts to pull the logfiles that get gzipped after a few days).  I don't use the normal file open dialog at all.

That said, this is still an improvement of my current process:
  • pull file via FTP
  • Alt-Z (brief keymap) to open a command shell (to the current buffer directory)
  • start . (to open file explorer)
  • right-click the GZ and unzip it
  • right-click the logfile and SendTo SE
  • discard the gz buffer to release the local copy of the file

This new feature will eliminate a couple of those steps, at the cost of making me type out the logfile name twice (logfile.log.gz/logfile.log).

Tighter integration to the buffer load (auto-explode) would be nifty.  Of course, my use-case of one file per gz is a lot simpler than n-files per gz.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: gz File Reading
« Reply #4 on: September 19, 2017, 09:10:10 PM »
I added an option for automatically decompressing .gz files for the next build. It will work for FTP. It's on by default. However, it will be off for you if you have an existing configuration. Go to Tools>Options>File Options>Open and turn on "Decompress .gz files on open".

This should be really convenient for you.

acg

  • Community Member
  • Posts: 13
  • Hero Points: 0
Re: gz File Reading
« Reply #5 on: October 03, 2017, 04:12:02 PM »
Just got to trying this today.  If I open a .gz up directly, I get prompted for the "create the file" and then it fails to open (either using File Open or SendTo).  File Open generates the warning in the lower right, "Error opening file.  Path not found".  If I open via the FTP window, I get "Unable to open local file <filename>.  Path not found"

I'm trying to open the same file over and over, and I'm being prompted to create the same file over and over, which suggests the file isn't being created.  I created a file in the same directory (edit new file name, type in something, save) and that worked fine, so it's not a simple permissions issue.

It looks like it's trying to create the file under the gz (i.e., "<slickedit-ftp-path>\logfile.log.gz\logfile.log").  I only noticed that after creating the target filename expecting to no longer be prompted for "create the file".

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: gz File Reading
« Reply #6 on: October 03, 2017, 04:27:53 PM »
What happens if you try to open the attached .gz file using File->Open?

acg

  • Community Member
  • Posts: 13
  • Hero Points: 0
Re: gz File Reading
« Reply #7 on: October 03, 2017, 06:20:07 PM »
Create File prompt for junk.cpp.gz\junk.cpp and then Warning, Error opening file:  File not found.

SlickEdit Pro 2017 (v22.0.0.5 64-bit)

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: gz File Reading
« Reply #8 on: October 03, 2017, 06:26:39 PM »
I tried Windows and Linux and both work for me. No idea what's different.

Try a default config:  vs +new -sc <new-config-dir>

acg

  • Community Member
  • Posts: 13
  • Hero Points: 0
Re: gz File Reading
« Reply #9 on: October 03, 2017, 07:50:27 PM »
Same with a new configuration.

Oh well, appreciate the attempt.  If I can narrow down the problem any, I'll post.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: gz File Reading
« Reply #10 on: October 03, 2017, 08:00:28 PM »
Are you still using FTP? These tests were supposed to be without ftp involved. Just to test the basics.

acg

  • Community Member
  • Posts: 13
  • Hero Points: 0
Re: gz File Reading
« Reply #11 on: October 03, 2017, 08:12:48 PM »
Just using File Open.  I assumed you were also testing the gz version, in case that was a variable factor.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: gz File Reading
« Reply #12 on: October 03, 2017, 08:31:47 PM »
I used the file open dialog and selected "junk.cpp.gz" from the list. I've tested other ways and they worked too.

acg

  • Community Member
  • Posts: 13
  • Hero Points: 0
Re: gz File Reading
« Reply #13 on: October 03, 2017, 10:54:50 PM »
Tried it on my home machine, fresh install, previous version installed 2015 (whoops).  No prompt to create the file, but still the same file not found warning.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: gz File Reading
« Reply #14 on: October 04, 2017, 12:09:53 AM »
When I open junk.cpp.gz with v20 or v21, SlickEdit opens the file in Hex mode.

Do you have some sort of driver installed which messes with .gz files?