Biti u stanju komprimirati datoteke tako da ih je lakše dijeliti i / ili prevoziti, može olakšati naše elektronske živote, ali ponekad možemo vidjeti neobične ili neočekivane rezultate veličine nakon što ih stisnemo. Zašto je to? Danas SuperUser Q & A post ima odgovore na pitanja zbunjenog čitatelja.
Današnja pitanja i odgovori nam se javljaju zahvaljujući SuperUseru - podjele Stack Exchange-a, zajednice-driven grupiranja Q & A web stranica.
SuperUser čitač sixtyfootersdude želi znati zašto zip može komprimirati jednu datoteku bolje od više datoteka s istom vrstom sadržaja:
Suppose that I have 10,000 XML files and want to send them to a friend. Before sending them, I would like to compress them.
Method 1: Do Not Compress Them
Results:
Image
Method 2: Zip Every File Separately and Send Him 10,000 Zipped XML Files
Command:
Results:
Image
Method 3: Create a Single Zip File Containing All 10,000 XML Files
Command:
Results:Image
Method 4: Concatenate the Files Into a Single File and Zip It
Command:
Results:Image
Questions
Why do I get such dramatically better results when I am just zipping a single file?
I was expecting to get drastically better results using method 3 rather than method 2, but I do not. Why is this?
Is this behaviour specific to zip? If I tried using Gzip, would I get different results?
Additional Info
Image
Meta Data
One of the answers given suggests that the difference is the system meta data that is stored in the zip file. I do not believe that this can be the case. To test it, I did the following:
The resulting zip file is 1.4 MB. This means that there is still approximately ten MB of unexplained space.
Zašto zip može komprimirati pojedinačne datoteke bolje od više datoteka s istom vrstom sadržaja?
Odgovor
Alan Shutko i Aganju imaju odgovore za nas. Prvo, Alan Shutko:
Zip compression is based on repetitive patterns in the data to be compressed, and the compression gets better the longer the file is, as more and longer patterns can be found and used.
Simplified, if you compress one file, the dictionary that maps (short) codes to (longer) patterns is necessarily contained in each resulting zip file; if you zip one long file, the dictionary is ‘reused’ and grows even more effective across all content.
If your files are even a bit similar (as text always is), reuse of the ‘dictionary’ becomes very efficient and the result is a much smaller total zip file.
Slijedi odgovor Aganju:
In zip, each file is compressed separately. The opposite is solid compression, that is, files are compressed together. 7-zip and Rar use solid compression by default. Gzip and Bzip2 cannot compress multiple files, so Tar is used first, having the same effect as solid compression.
As xml files have similar structure (and probably similar content), if the files are compressed together then the compression will be higher.
For example, if a file contains the string “” and the compressor has already found that string in another file, it will replace it with a small pointer to the previous match. If the compressor does not use solid compression, the first occurrence of the string in the file will be recorded as a literal, which is larger.
Imate li nešto za objašnjenje? Zvuči u komentarima. Želite li pročitati više odgovora od drugih tehnoloških korisnika Stack Exchangea? Pogledajte ovdje cijelu raspravu.
Dok radimo što možemo kako bismo zaštitili prijenosna računala, postoje vremena kada se klavijature oštećuju bez obzira na mjere koje poduzimamo. Je li bolje zamijeniti samo ključeve koje trebate ili cijelu tipkovnicu? Danas SuperUser Q & A post ima neke korisne savjete u vezi čitatelja tipkovnice woes.
Ako koristite komprimirane mape ugrađene u sustav Windows da biste stvorili zip datoteke, možda ste primijetili da stvara datoteku s istim imenom kao i odabrana datoteka, što se čudno pri odabiru više datoteka. Evo kako da odaberete pravo ime.
Najvjerojatnije ste čuli za usluge poput Dropboxa, koji se upotrebljavaju za pohranu datoteka u sinkronizaciji na više računala. Međutim, što ako želite izvršiti ovu operaciju na jednom stroju? To jest, zadržite datoteke koje imaju isti naziv datoteke u sinkronizaciji na stroju tako da kada se jedna od datoteka mijenja, sve se ažuriraju.
Ashampoo ZIP besplatno može se koristiti za arhiviranje, arhiviranje datoteka lako. Možete jednostavno urediti, brisati, komprimirati, čitati i popravljati arhivske datoteke u sustavu Windows 10/8/7.
Koristeći ovaj besplatni kompresor datoteka na mreži pod nazivom YouCompress možete komprimirati MP4, MOV, MP3, PDF, PNG, JPG, JPEG, GIF, video, audio datoteke, dokumente, pjesme i slike bez gubljenja kvalitete. Dakle, pokušajte komprimirati datoteke koristeći ovaj besplatni online kompresor datoteka.