Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

uncompressed file in zip archive

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
guy
LXF regular


Joined: Thu Apr 07, 2005 1:07 pm
Posts: 1069
Location: Worcestershire

PostPosted: Tue Oct 15, 2013 4:57 pm    Post subject: uncompressed file in zip archive Reply with quote

I need to put several files in a zip archive, the first has to be uncompressed (this is an ePub format ebook and the first file contains the mime type which utility tools need to be able to read without understanding decompression).

My Debian/Gnome desktop insists on compressing the file, so does gzip which is probably why. Can anybody suggest a zip creator for debian that does allow individual choice of compression?
_________________
Cheers,
Guy
The eternal help vampire
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8449
Location: Warrington, UK

PostPosted: Tue Oct 15, 2013 5:13 pm    Post subject: Reply with quote

gzip does not create zip files, it gzips single files or data streams. You want zip and use the -Z option to not compress the first file

Code:
zip -Z store archive.zip firstfile
zip archive.zip all the other files


You can also use the --suffixes option to specify the suffixes of files that should not be compressed, but if you need the uncompressed file to be first in the archive, the above example is more reliable.
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
guy
LXF regular


Joined: Thu Apr 07, 2005 1:07 pm
Posts: 1069
Location: Worcestershire

PostPosted: Tue Oct 15, 2013 7:13 pm    Post subject: Reply with quote

guy@hostname:~/Downloads$ zip -Z store archive.zip mimetype
bash: zip: command not found

hence my attempt to use gzip. I tried looking in the repos but found loads of zip utils, many obviously not what was wanted and no easy way to pick a winner.
_________________
Cheers,
Guy
The eternal help vampire
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8449
Location: Warrington, UK

PostPosted: Tue Oct 15, 2013 8:16 pm    Post subject: Reply with quote

Which distro? On most the package is simply called zip.

The only thing zip and gzip have in common is the last three letters of their names.
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
guy
LXF regular


Joined: Thu Apr 07, 2005 1:07 pm
Posts: 1069
Location: Worcestershire

PostPosted: Tue Oct 15, 2013 8:43 pm    Post subject: Reply with quote

debian squeeze
_________________
Cheers,
Guy
The eternal help vampire
Back to top
View user's profile Send private message
guy
LXF regular


Joined: Thu Apr 07, 2005 1:07 pm
Posts: 1069
Location: Worcestershire

PostPosted: Wed Oct 16, 2013 5:06 pm    Post subject: Reply with quote

Ah, found zip. Not installed by default. Oddly, Synaptic's search wouldn't find it even though it's in the repos. I had to scroll to the bottom of the list. It found unzip though.

And yay, it worked! I have a valid ePub file. Very Happy
_________________
Cheers,
Guy
The eternal help vampire
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast