View Single Post
Old 07-24-2010, 11:36 AM   #10
pietvo
Reader
pietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notespietvo can name that song in three notes
 
pietvo's Avatar
 
Posts: 520
Karma: 24612
Join Date: Aug 2009
Location: Utrecht, NL
Device: Kobo Aura 2, iPhone, iPad
Quote:
Originally Posted by st_albert View Post
Be careful with that. If you take the above commands literally, you are creating the epub in the same directory as "mimetype" (which directory is part of the epub itself), and you are zipping the epub into itself in the second line. try instead
Quote:
Originally Posted by Jellby View Post
Just to be picky, the second command zips everything, which includes "mimetype" again, so it could be compressed instead of just stored.
Of course book.epub was meant to be a placeholder. But it is good to warn about both of these potential problems. Both can be taken care of by adding the -u switch to the second command line.

zip -0Xq book.epub mimetype
zip -Xur9D book.epub *

My man page (Mac OS X) says
Quote:
-u
--update
Replace (update) an existing entry in the zip archive only if it has been modified more recently than the version already in the zip archive. For example:

zip -u stuff *

will add any new files in the current directory, and update any files which have been modified since the zip archive stuff.zip was last created/modified (note that zip will not try to pack stuff.zip into itself when you do this).
pietvo is offline   Reply With Quote