Why do RAR files stink?
Posted: Wed Mar 07, 2012 4:58 am
Not to start a flame war (I rarely use RAR at all) but I would like to know what makes you say that.Combuster wrote:Also, RAR files stink</troll>
The Place to Start for Operating System Developers
https://f.osdev.org/
Not to start a flame war (I rarely use RAR at all) but I would like to know what makes you say that.Combuster wrote:Also, RAR files stink</troll>
There're many problems with rar.Hobbes wrote:Not to start a flame war (I rarely use RAR at all) but I would like to know what makes you say that.
Not so, zip was created in 1989 for DOS, tar dates back to 1975. Nevertheless tar's supported by far more systems than pkzip..zip is the "lingua franca" of archives. .tar.gz, tar.bz2 and .7z are the runner-ups. Anything else is unwieldly, IMHO.
This is true - however I see quite a few people saying 'try my os' and giving an archive of source or objects, call me lazy but I don't like doing the extra leg-work of compiling stuffSolar wrote:@ turdus:
It's not simply a question of "who was first". It's a factor of "what's best supported" and "what is the least hassle to handle". ZIP is like FAT32 - no-one really likes it, but if you want to play it safe and go for maximum compatibility, there's nothing better.
Additionally, ZIP archives can be "browsed" just like another folder. TAR archives don't allow that.
@brain:
I cannot quite fathom where you see any similarities in use or purpose between an archive and an ISO file. Apples and oranges. About the only thing comparable is an ISO file and an uncompressed TAR - when was the last time you've seen one of those?
Anyways, I don't know which thread turdus picked that Combuster quote from, and I was talking about archivers in general. While an ISO image file is acceptable for distributing an OS in compiled form, you wouldn't use it for a source tree, your master thesis, or your picture collection, would you?
Well, pkzip is officially not supported on unices, it's eol.Solar wrote:It's a factor of "what's best supported"
As for compatiblity it's approval for being a Standard was denied. Luckily the file format is public domain and implemented in many decompressors. If you really want to go for maximum compatiblity, you should choose portable archive: http://en.wikipedia.org/wiki/Pax_%28Unix%29 (which uses tar format by default by the way). With zip you'll never archive your root linux partition without loss of information for example.and "what is the least hassle to handle". ZIP is like FAT32 - no-one really likes it, but if you want to play it safe and go for maximum compatibility, there's nothing better.
Don't know what you're talking about. No such limitation of the format itself. Besides, I browse tar and cpio archives like directories on Win (Total Commander), on Mac (Forklift), and on Linux (mc) fine, thanks.Additionally, ZIP archives can be "browsed" just like another folder. TAR archives don't allow that.
Pkzip is an utility, not a format.turdus wrote:Well, pkzip is officially not supported on unices, it's eol.
Compatibility has little to do with what is "standard" and what is not. The "export" keyword was part of the C++ standard for over a decade, but no-one wrote software that way, because it would have been incompatible.As for compatiblity it's approval for being a Standard was denied.
PAX is an utility, not a format - and you might have missed it, but there are parts of the computing world who don't give a damn about POSIX, which is a "standard" for Unix derivates.If you really want to go for maximum compatiblity, you should choose portable archive...
Correct. I also wouldn't require maximum ease of portability from such an archive, now would I? Since a Windows user couldn't do anything with file mode, last access time and file owner anyway...With zip you'll never archive your root linux partition without loss of information for example.
ZIP is random access (as it compresses each file individually), tar is sequential access (and you have to read the whole archive to even give a table of contents). If you "browse" them frequently, as you claim, you should have noticed that. Well, it doesn't matter for small archives on fast machines, I grant you that much...Don't know what you're talking about. No such limitation of the format itself.Additionally, ZIP archives can be "browsed" just like another folder. TAR archives don't allow that.
See above. Of course you use a native format for native use. Unix archives are tarballs. Amiga archives are .lha. And I wouldn't advocate using ZIP for everything.For example I work with mainframes and unices for living, there nobody uses zip. Never ever.
Apart from the sentiments posted above, it was because the computer I was on at that time didn't have the tools to deal with RAR files that made me share that sentiment.Hobbes wrote:I would like to know what makes you say that.
I also wouldn't require maximum ease of portability from such an archive, now would I?
Hmm, seems contradiction.But if you are packing a couple of files so that some unknown person of unknown skill on some unknown platform shall have the minimum amount of hassle in unpacking it
True. Just because you have to read the whole archive to create a table of contents doesn't mean it cannot be used as a directory, all I'm saying.ZIP is random access (as it compresses each file individually), tar is sequential access (and you have to read the whole archive to even give a table of contents). If you "browse" them frequently, as you claim, you should have noticed that. Well, it doesn't matter for small archives on fast machines, I grant you that much...
I would go with tar.gz without hesitation. If he/she asks what to do with it, I reply "press Enter on it in TC". And guess what people can handle it without asking. It's also true I rarely send anything to end users (managers in worst case), so my experience is far from being representative.But if you are packing a couple of files so that some unknown person of unknown skill on some unknown platform shall have the minimum amount of hassle in unpacking it, ZIP is #1, with .tar.gz coming at #2 and .tar.bz2 a distant #3.
Any proof? Tar is available for DOS, Win3.11-Win7, AmigaOS, OS/2, MacOS, MacOSX, all unix derivatives, etc. etc. etc. Even my cellphone stores it's backup in tar.gz. I'm saying, tar is more than a decade older and much much simplier, so it had a vantage point to build it's support base. It's hard to believe the opposite....no other archive format has a bigger installed support base...
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <zlib.h>
int main(int argc,char** argv)
{
gzFile *f;
char blk[512];
if(argc<2) { printf("%s <tar file>\n",argv[0]); exit(0); }
f=gzopen(argv[1],"r");
if(f==NULL) { printf("Auch.\n"); exit(1); }
while(gzread(f,&blk,512)!=0){
char *data;
int size,blksize;
if(blk[156]!='0') continue; //normal file?
sscanf(blk+124,"%o",&size);
blksize=((size/512)*512)+(size&0x1ff?512:0);
printf("%8d bytes %6d blks %s\n",size,blksize/512,blk);
data=malloc(blksize); gzread(f,data,blksize); data[size]=0;
//do things with data
free(data);
}
gzclose(f);
}
I don't need the utilities 'pkzip' or 'WinZip' to create or extract ZIP files. In fact, I don't think I ever have.turdus wrote:@Solar: about utility and file format: if you don't have the utility you cannot deal with the format, am I right?
But you did read what I wrote, huh?I also wouldn't require maximum ease of portability from such an archive, now would I?Hmm, seems contradiction.But if you are packing a couple of files so that some unknown person of unknown skill on some unknown platform shall have the minimum amount of hassle in unpacking it
I can use a screwdriver for hammering in a nail. Actually, I have done that. But that doesn't change the fact that the best tool for the purpose is a hammer.Just because you have to read the whole archive to create a table of contents doesn't mean it cannot be used as a directory, all I'm saying.
*sigh*Any proof? Tar is available for DOS, Win3.11-Win7, AmigaOS, OS/2, MacOS, MacOSX, all unix derivatives, etc. etc. etc. Even my cellphone stores it's backup in tar.gz....no other archive format has a bigger installed support base...
...for a console user, which my mother-in-law or my sister aren't. They're using Windows and archive things in ZIP because that is what Windows does. .tar.gz is an unknown file extension on their systems.I'm saying, tar is more than a decade older and much much simplier...
Yep, you're cool. Actually posting the code, however, was a bit juvenile, don't you think?Hell, it's so f*cking simple, I can write a tar.gz unpacker for you in ~20 lines...