PDA

View Full Version : How do .zip files work?


dlinkwit27
8th September 2003, 19:39
Well, how do they? and Why don't OS and files jsut make themseves smaller by default?

zootm
8th September 2003, 19:44
there are many, many ways of compressing data. i'm not really an expert so i can't answer your first question.

the answer to the second one is that it takes CPU time and resources to compress and decompress files - zip files are fine for things you don't use much, but to use a file you have to unzip it - if this is a system file, you don't want to be constantly zipping and unzipping every time you change or use the file. it would slow your system down an awful lot.

dylman
8th September 2003, 19:49
http://computer.howstuffworks.com/file-compression.htm

godoncrack
8th September 2003, 21:14
winME and XP both have built in compression :)

mikm
8th September 2003, 21:24
It isn't as powerful as a standalone, though.

Merlin
8th September 2003, 21:30
The built-in NTFS compression in windows XP annoys me. All it does is slow down certain apps. I have 40+ gigs of free space, I don't need to compress a 400K text file.

Haven't found a way to turn it off. Disk Defragmenter insists on compressing files when it really doesn't need to.

Viper007Bond
8th September 2003, 21:56
What annoys me is that programs like Winzip don't compress accross multiple files. If you zip 8 identical images, it should only be slightly larger than the size of one of those images zipped. :-/

Merlin - like are all files showing up as blue? (XP's code for compressed) If so, just right click the foler, hit properties, then advanced, then uncheck "compress contents to save diskspace" or whatever it's called.

Merlin
8th September 2003, 22:17
Yeah, but that doesn't stop it getting compressed in the first place, which would be better. :)

Love the font you're using for audio-tracker. :up:

bored154
8th September 2003, 23:31
zip just has them in temp then decompresses them and moves them to the folder you want(thats what i think im probabily wrong i know). My reason for believing that is because it says moving from what ever temp folder it has it in to the folder you are sending it to.

eleet-2k2
9th September 2003, 01:01
Originally posted by dlinkwit27
Well, how do they? and Why don't OS and files jsut make themseves smaller by default? In answer to your last question, it sounds like you mean: "Why doesnt Windows just say it's a smaller file size?". If that's the case, then it's wrong to ask that question because a program cant just dictate an arbitrary size for a file, like a 100 MB movie file occupying 100 KB of diskspace, because file contents are dictated by teh amount of bytes written to them, and in essence how many bits of data on the hard drive were used to store the entire contents of the file, which, in total is the size of the file. It would be nice to have the movie example be true, but out data would corrupt quite easily as we cant just expand out physical capacity just cuz you want it to.

If you meant compression wise, "Why cant the compression be better and stronger to make smaller files?", then it all depends on the crazy math and algorithms used, but I'll bet that eventually, mathematically, it's impossible to compress beyond a certain point.

dlinkwit27
9th September 2003, 01:28
I meant the second one. If a program can be compressed, why does the OS jsut not do that in the first place, but zootm 'splained why that wouldn't work.

teh Nightwing
9th September 2003, 02:31
MAN.....I REMEMBER WHEN ALL WE HAD WAS DOS! And you could get MSUNZIIP.ExE and add it to your c:\dos\command\ file! And....it was so great!

teh Nightwing
9th September 2003, 02:32
^OOPS! I meant PKUNZIP.exe

dlinkwit27
9th September 2003, 02:32
use http://forums.winamp.com/images/edit.gif that button next time plase.

DragonSon
9th September 2003, 02:37
Mayhaps Atmo could enlighten us all...

teh Nightwing
9th September 2003, 02:48
HAH! Crap.....Sorry! I didn't even use the edit button! Please forgive me everyone! I usually do but....I don't know what came over me

liquidmotion
9th September 2003, 02:49
HUFFMAN ENCODING!

s0be
9th September 2003, 05:50
in response to zipping multiple identical files...

under unix, you generally make tar.gz/bz2 files.

what tar does is take all the files and merge them into a single file. Then your choice of compression programs (bzip2 is better than gzip, which is compatible with regular old zip) compresses the tar file. it's slightly slower to compress this way because it has to search a much much larger file for patterns, but it can save quite a bit.

s0be

Viper007Bond
9th September 2003, 09:24
Originally posted by Merlin
Love the font you're using for audio-tracker. :up:
Me too! :D Credits to gigantus for giving it to me to install on my AT remote. Here's the font if you're interested. :)

http://www.1001fonts.com/font_details.html?font_id=2578

Coman
10th September 2003, 05:05
howstuffworks is great, it explains everything.

bored154
10th September 2003, 05:53
even how to pic a lock :)

Coman
10th September 2003, 23:07
where? linky?

bored154
10th September 2003, 23:18
http://home.howstuffworks.com/lock-picking.htm

they have little flash things or something to show you step by step

Coman
11th September 2003, 00:54
man that's great.

one of the authors of the site used to be my neighbor :)

bored154
11th September 2003, 03:24
cool, did you help him or give him some ideas?

whiteflip
11th September 2003, 06:07
When you put a bunch of identical files in a zip file try zipping the zip file. The new zip file will see the patern in the old zip file and compress it all

Or you can put all the pictures in a cab file.

Coman
11th September 2003, 22:15
of course.

Starbucks
11th September 2003, 23:51
If you zip 8 identical images, it should only be slightly larger than the size of one of those images zipped. :-/ Image files already contain their own compression, so further compression won't make it much smaller. Same goes with ISO files. I've got one that is 700MB, extracted is 1.6GB!!

whiteflip
12th September 2003, 03:42
Starbucks I beleive you misread his statement.

Even with a compressed image format like shitty jpegs or awesome PNG's if you have 8 identical files for some odd reason and you compress those 8 identical files into the same zip file than the zip file should recognize the pattern across the multiple files and just zip it once and add the extra data in the zip file to say that when you view or extrat any of the 8 image files that its comming from that single source dilly.

Makes senese?