Author Topic: Using SlickEdit to edit .gz files?  (Read 9772 times)

ewjax

  • Community Member
  • Posts: 10
  • Hero Points: 0
Using SlickEdit to edit .gz files?
« on: September 10, 2006, 06:42:50 pm »
Hello,

I work in an engineering office.  Our default work environment provides the Crisp editor for text editing, and as part of the work-flow processes we use, our text files often become gzipped, for space reasons.  Example "MyBigTextFile.out" will get turned into "MyBigTextFile.out.gz". 

Part of my work experience includes software development, where I used SlickEdit almost exclusively, and I still use it in place of Crisp for most of my work now.  HOWEVER, Crisp has one feature that I am missing in SlickEdit - Crisp can auto-magically open the .gz files mentioned above for editing.  I believe it is relying on the external gzip.exe utility to do this, although it may be using a native ability to gunzip the files prior to editing - I'm not sure.

I would very much like to configure SlickEdit to be able to at least open/view, if not edit, .gz files.  Any advice is appreciated.

Thanks!
Elliott


ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
Re: Using SlickEdit to edit .gz files?
« Reply #1 on: September 13, 2006, 03:47:57 pm »
Interesting request.  How does it handle the case where there are multiple files in the zip? When you edit the file, does it auto-magically put the edits back into the zip file? Are there any other unusual use cases we need to consider?

Can't promise we'll implement this in the next release, but I'll see what we can do.

--Scott

hs2

  • Senior Community Member
  • Posts: 2744
  • Hero Points: 288
Re: Using SlickEdit to edit .gz files?
« Reply #2 on: September 14, 2006, 03:10:13 pm »
Would be great if Slick would provide support that in the future.

If there are mult. files (or even files in mult. sub-dirs) in an archive it should be handled like changing into a (virt. -> temp.) directory.
Maybe a temp - dir with the unpacked file(s)/dir(s) could be a reasonable solution anyway.
Some tools w/ transparent archive access (e.g. TotalCommander) do it this way.
If the contents (one or more files) of the temp dir has changed the user could be asked if he/she wants to update the archive or save as new file (outside). Could be a (global) config item to avoid annoying popups...

HS2

BTW: Was a also CRiSP user up to v9 before I discovered Slick...

ewjax

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: Using SlickEdit to edit .gz files?
« Reply #3 on: October 14, 2006, 12:25:57 am »
Interesting request.  How does it handle the case where there are multiple files in the zip? When you edit the file, does it auto-magically put the edits back into the zip file? Are there any other unusual use cases we need to consider?

Can't promise we'll implement this in the next release, but I'll see what we can do.

--Scott

Hi Scott, sorry for the delay responding and thanks for the reply.

To answer your questions:
1.  Gzip files are unlike .zip files or .tar files in that they do not contain multiple files, they are simply compressed versions of the original file.
2.  I'm actually not certain if Crisp can edit .gz files and have the changes saved.  I actually think it will.  It can certainly open them for viewing, which would meet all my needs at least - the work flow process I was describing earlier only does the gzip thing on RO files, so for me at least, I don't have a strong need to edit .gz files. 
3.  Gzip files are created using the gzip utility, which is PD source and has binaries available on a wide variety of platforms, including windows, HPUX, linux, etc.  Again, I'm not sure if Crisp is using that utility to do its work, or has the capability native to the editor.
4.  I personally don't see a strong need to be able to navigate and edit within .zip files, as the navigation function is handled very transparently by the native Win XP, or at the very least WinZip, from which you can launch the editor normally just as if you were launching it from within any other directory.

hs2

  • Senior Community Member
  • Posts: 2744
  • Hero Points: 288
Re: Using SlickEdit to edit .gz files?
« Reply #4 on: October 14, 2006, 06:24:44 am »
Many tools doing transparent zip handling use http://www.info-zip.org/pub/infozip/.
And it's open source and multi-platform.

HS2

tbarritt

  • New Community Member
  • Posts: 1
  • Hero Points: 0
Re: Using SlickEdit to edit .gz files?
« Reply #5 on: November 09, 2006, 07:15:30 pm »
I just installed v11 and hopefully looked in the help window for a clue to how to open .gzip files. Alas. :( that is why I am here in this thread. PERL can do it easily as can JAVA. Would be nice to open a .gzip file, edit it as readable, and save right back to .gzip or be given the option.
Please?
Thanks....but thanks for a great product anyway.
-Tim

ewjax

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: Using SlickEdit to edit .gz files?
« Reply #6 on: May 23, 2007, 03:42:28 pm »
/bump

I've not seen v2007 yet, was this feature added by chance?  I'd sure like to see it.

Best,
Elliott


Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2920
  • Hero Points: 438
Re: Using SlickEdit to edit .gz files?
« Reply #7 on: May 23, 2007, 06:42:12 pm »
The barrier to entry with .gz files is the GNU copyright, however, we could decompress it to a temp location using an external tool, that would be legal, just not quite as performant.

On a related note:  We do support opening (read-only) files in .zip files (or .jar).  Just treat the .zip file as a directory, for example:   e c:\temp\testfix.zip\docs\readme.txt

Unfortunately, the GUI does not support path completion or browsing into a zip file.  That's a hole that we would like to fill at some point, but there are always issues of time and priorities.  I think supporting directly opening .gz files also falls into that category of feature, with the added fact that disk space has gotten really inexpensive and there are compressed file systems (such as NTFS with compression) have made compressing individual files to save space less of an issue than it was 20 years ago.

twoods

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Re: Using SlickEdit to edit .gz files?
« Reply #8 on: May 24, 2007, 11:57:29 am »
The barrier to entry with .gz files is the GNU copyright, however, we could decompress it to a temp location using an external tool, that would be legal, just not quite as performant.

Dennis,

If you do look at implementing this, zlib (http://zlib.net/) is capable of encoding and decoding gzip streams.  The license allows for use in commercial applications.

-Tim

RightClick

  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
Re: Using SlickEdit to edit .gz files?
« Reply #9 on: August 23, 2016, 02:35:35 pm »
I realize it has been 9+ years since the last post, however our team is new to SlickEdit, and from what we can tell SlickEdit still does not have the capability to open a .gz text file nativity in read only mode.  Let us know if we have missed an option that has since been implemented.  This would be a really nice feature that we currently use with Crisp.

Thank you,

RightClick

Tim Kemp

  • Senior Community Member
  • Posts: 537
  • Hero Points: 91
Re: Using SlickEdit to edit .gz files?
« Reply #10 on: August 24, 2016, 05:35:40 pm »
I had no idea that Crisp still existed! I last used it nearly 20 years ago. I have fond memories of it.

RightClick

  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
Re: Using SlickEdit to edit .gz files?
« Reply #11 on: August 24, 2016, 06:16:34 pm »
Yep, still exists, and heavily used in our organization (for many years now), but we are starting venture out into unexplored territory evaluating different editors and so far we are liking SlickEdit.

Thanks,

-RightClick

Tim Kemp

  • Senior Community Member
  • Posts: 537
  • Hero Points: 91
Re: Using SlickEdit to edit .gz files?
« Reply #12 on: August 24, 2016, 06:50:19 pm »
SlickEdit is great. Although it's not a superset of all other editors as some would like, I think it's the best editor I've ever used.

jporkkahtc

  • Senior Community Member
  • Posts: 1900
  • Hero Points: 184
  • Text
Re: Using SlickEdit to edit .gz files?
« Reply #13 on: August 24, 2016, 08:36:48 pm »
I wonder if Save / Load could have a user-programmable configuration to add features like this.
Understandably, it would not be so highly optimized or feature rich as standard save/load.

Slick already has at least a couple of these: Loading files from ZIP archives, and FTP save/load.
Are there others?

Seems like there are a couple of options here:
1: The Simple way
User code to read/write the file from an alternate data store and use a local temporary file to talk to slick.
Slick would call out to user code 'load_redirection(filename, options, temporary_filename)'
In this case, the user code would simply tell slick a different filename.
FTP loading could be done this way - where filename is "ftp://...", and the user code would go fetch the file and store it in "temporary_filename"

Save would be similar - slick would pass in the temporary local filename and the URL to write it should be written.

2: Harder
Like 1, but instead of a temporary file the user code would work directly with slick buffers and avoid using a temporary file

3: fake file system
Implement a simple filesystem protocol with just a few functions similar to POSIX that the user would implement in a C++ dll.
The functions would include possibly simplified versions of: open, close, read, write, stat.
You could then have a "vsFsFtp.dll", "vsFsZip.dll", "vsFsGZ.dll", "vsFsISOImage.dll", etc...
Presumably the "native" filesystem code in Slick requires more features than this interface would provide ... the idea here is simplicity not optimal performance. Some Slick features wouldn't work with these pluggable file systems.
Its possible to have different levels of support such as
BasicReadOnly - slick would only ever read file from start to end - no seeks.
BasicReadWrite - slick would only ever read or write the file from start to end - no seeks.
AdvancedReadOnly - also allow seeking
AdvancedReadWrite- also allow seeking to be able to write parts of a file.

Or, maybe the dll would provide hints to Slick to indicate what it supports: Maximum file size, random access, filename limits, performance hints (such as: Writing to FTP is slow and unreliable, writing to a ZIP file could be really slow if the whole zip file needs to be copied to change one file, etc...).


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5145
  • Hero Points: 425
Re: Using SlickEdit to edit .gz files?
« Reply #14 on: August 25, 2016, 02:08:34 am »
We would likely implement .gz support by building it in like the .zip support. It's a lot more powerful that way. No problems with the license anymore. It's a fair amount of work to do it right but we have all the internal API's we need. This could be a v22 feature.

Editing a file in a .gz file would look something like blah.gz/filename where filename is either retrieved from the compressed file or simply the same name as the .gz file without the .gz (used if the .gz file data doesn't contain the filename). We probably wouldn't support multiple files in the .gz file due to the fact that listing the filenames requires decompressing the entire .gz file and multiple files are rarely used. Since the internal API's can make .gz files look like a directory, things like completion (blah.gz/ would list the one filename), multi-file find ( (use path like blah.gz/ -- must have trailing slash), sgrep, etc. would all just work. There also could be an option for "edit" to automatically convert a specification of blah.gz to blah.gz/filename. This is ambiguous because SlickEdit supports hex editing so this will likely be off by default.