Page 1 of 1
zip_extract doesn't work if file extension isn't "zip"
Posted: 26 Dec 2014 12:03
by aliteralmind
Sublime Text stores its "packages" (downloadable extensions) as "PackageName.sublime-package", but it's just a zip file--you change "sublime-package" to "zip" if you want.
The zip_extract function doesn't work unless you change the extension to zip.
Re: zip_extract doesn't work if file extension isn't "zip"
Posted: 26 Dec 2014 12:09
by highend
I hardly call this a bug... Windows relies on extensions unlike other OS like Unix / Linux. Write a script that temporarily renames the file, extract it and rename it back.
Re: zip_extract doesn't work if file extension isn't "zip"
Posted: 26 Dec 2014 12:11
by aliteralmind
I disagree.
If the file is named "PackageName.zip", then you have to pass in "PackageName.zip". "PackageName" does not work.
This pretty strongly implies that passing in another extension should also work, as long as it's a zip file of course! "PackageName.sublime-package" is a just zip file in disguise.
Re: zip_extract doesn't work if file extension isn't "zip"
Posted: 29 Dec 2014 16:20
by zer0
By the same token, I would be curious to ask author(s) of that product: if it's in effect just a zip file, why not have it with its proper extension, why disguise it? If their answer would be "because that's how our product works", the same is true of XY

Re: zip_extract doesn't work if file extension isn't "zip"
Posted: 29 Dec 2014 16:36
by highend
Don't expect an answer from the programmer of ST. The product is merely dead...
Re: zip_extract doesn't work if file extension isn't "zip"
Posted: 29 Dec 2014 16:42
by Filehero
highend wrote:Don't expect an answer from the programmer of ST. The product is merely dead...

They/he took about 60$ per license, right?
Re: zip_extract doesn't work if file extension isn't "zip"
Posted: 29 Dec 2014 16:45
by highend
70^^
Don't know what to use next. Atom is so slow (and it has some nasty bugs in Windows).
Brackets looks nice but it's imho too much tailored for web development.
NeoVim would be cool but no Windows version in sight *sigh*
Getting off topic here xD
Re: zip_extract doesn't work if file extension isn't "zip"
Posted: 29 Dec 2014 18:35
by bdeshi
I believe (honest!) ST isn't quite dead yet. The latest ST3 dev build was released on October.
I guess our perspective on development speed was
skewered skewed by somebody

.
Getting off topic here xD

Re: zip_extract doesn't work if file extension isn't "zip"
Posted: 29 Dec 2014 18:39
by aliteralmind
highend wrote:Don't expect an answer from the programmer of ST. The product is merely dead...
Well, I don't think it's dead, as a new beta was released in October. But even if it were, it's still a good enough product to carry me through many more years of coding.
As far as why they name it *.sublime-package instead of *.zip, I don't know why it should matter. It's a zip file. It has a different name.
Re: zip_extract doesn't work if file extension isn't "zip"
Posted: 29 Dec 2014 19:04
by highend
I don't know why it should matter
Because it doesn't use the .zip extension *sigh* and btw, a file name like "PackageName.zip" IS NOT THE SAME AS "PackageName".
The last beta release was nothing more than a placebo (imho)... Pretend that you're actively maintaining a product, get some income of new users. Compare it to AdMuncher. He is promising things for many many years (v5 is coming out soon! https support? yeah, coming!) and in reality...
Jon has been (more than a year ago but still) a _very_ active developer. Bugfixes & new features every few weeks. There are a lot of outstanding bugs and there aren't fixes for them (any more) since mostly a year.
karisublime is the "official voice" for Jon in the forum. 1,5 years there, 7 posts, her last one is 4 months old. There isn't anything to say about the (which?) future of ST...
Jon would have been better off selling ST as a whole at the time he lost interest in developing it any further :/
Re: zip_extract doesn't work if file extension isn't "zip"
Posted: 30 Dec 2014 00:37
by Enternal
Lol! I think aliteralmind has been too influenced by the way Linux does things. On Windows at least (and Macintosh even though it's a derivative of BSD), extensions have a much higher importance so if you want to know what type of a file it is, it MUST have that extension. Of course, you could do things like Sublime Text and just change the extension to something else but then not many would know it's simply a zip file. I did not even know that even though I did write a script before that encrypts a keyfile and changed the extension from 7z (using 7-zip's built-in AES encryption) to DAT just to "hide" it. That's one reason why I wrote a little script to incorporate TrID because some company really like to "disguise" their files and it's annoying at times.
Otherwise, what if we name all jpeg image files as DC1352323.DAT. With your argument that "well, it's just a jpeg file so it doesn't matter", have fun with making photo software open it up. Those software are expecting a jpeg for a JPEG file. Not a dat for a JPEG file.
With that being said, I understand why Sublime Text does that. It's simply to let people know that this particular zip file is used for Sublime Text. The same thing can be said about Android's apk, Firefox's xpi, and others. That's all it is. HOWEVER, don't expect other programs to know that because generally, you don't need to open these files so what other programs expect from a zip file, it must have an extension of zip.
Re: zip_extract doesn't work if file extension isn't "zip"
Posted: 30 Dec 2014 18:47
by aliteralmind
Ah, "Bah Humbug!"

Re: zip_extract doesn't work if file extension isn't "zip"
Posted: 30 Dec 2014 19:27
by mwb1100
The zip program that I use (PowerArchiver) adds a context menu entry "Open with PowerArchiver..." that shows up for any file so I can open things like .sublime-package or .jar files (which are java packages that use the zip format) easily.
I'd guess that a similar context menu entry can be added to do the same for whatever opens zip files on your machine - though I don't know any of the details on how to do that.
Re: zip_extract doesn't work if file extension isn't "zip"
Posted: 30 Dec 2014 19:37
by aliteralmind
mwb1100 wrote: .jar files (which are java packages that use the zip format)
Jar files! Another major example! C'mon XYplorer!!!
(Happy New Years everyone.)
Re: zip_extract doesn't work if file extension isn't "zip"
Posted: 05 Jan 2015 16:11
by TheQwerty
FYI:
http://www.xyplorer.com/xyfc/viewtopic. ... 297#p89297
You can dive into the registry to add support for zip files with non-zip extensions.