Why do RAR files stink?

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Why do RAR files stink?

Post by qw »

Combuster wrote:Also, RAR files stink</troll>
Not to start a flame war (I rarely use RAR at all) but I would like to know what makes you say that.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Why do RAR files stink?

Post by Solar »

The format is proprietary; to my knowledge there are no freeware RAR archivers available; on several platforms, tools for un-archiving RAR are not installed by default.

.zip is the "lingua franca" of archives. .tar.gz, tar.bz2 and .7z are the runner-ups. Anything else is unwieldly, IMHO.
Every good solution is obvious once you've found it.
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: Why do RAR files stink?

Post by turdus »

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.
There're many problems with rar.
- proprietary code
- bad compress ratio (compared to bzip2 or 7z)
- non adaptive algorithm (unable to use with pipe, eg with cpio or tar)
- multiple volumes cannot be uncompressed on the-fly (you'll need the last volume too to extract a file in the first)
- cannot archive special files
...etc.
.zip is the "lingua franca" of archives. .tar.gz, tar.bz2 and .7z are the runner-ups. Anything else is unwieldly, IMHO.
Not so, zip was created in 1989 for DOS, tar dates back to 1975. Nevertheless tar's supported by far more systems than pkzip.
User avatar
brain
Member
Member
Posts: 234
Joined: Thu Nov 05, 2009 5:04 pm
Location: UK
Contact:

Re: Why do RAR files stink?

Post by brain »

Personally if I go to download some os (compiled not source) and its in a zip I would be kind of put off. Its an extra step in the way of what I want to do, eg. quickly try out a program. for a compiled release, I expect iso files or other images, but this is personal taste I guess :-)
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Why do RAR files stink?

Post by Solar »

@ 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?
Every good solution is obvious once you've found it.
User avatar
brain
Member
Member
Posts: 234
Joined: Thu Nov 05, 2009 5:04 pm
Location: UK
Contact:

Re: Why do RAR files stink?

Post by brain »

Solar 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?
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 stuff :-)
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Why do RAR files stink?

Post by Solar »

As I said, things are a bit different for OS distributions. An OS is expected to boot off some media, so you have to provide that media - and today that means an ISO image.

Even the Linux people understood that some time down the road.

But that's talking about a completely different application domain, that of drive images - .iso, .dcf, .vfd, .gho et al.

I'd be a bit miffed if the next release of Firefox or Chrome came as .iso...
Every good solution is obvious once you've found it.
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: Why do RAR files stink?

Post by turdus »

Solar wrote:It's a factor of "what's best supported"
Well, pkzip is officially not supported on unices, it's eol.
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.
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.
Additionally, ZIP archives can be "browsed" just like another folder. TAR archives don't allow that.
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.

Don't get me wrong, I prefer zip to rar too, but it's not so standard nor useful as you suggest (maybe widely spread on home computers running Win, but not other segments). For example I work with mainframes and unices for living, there nobody uses zip. Never ever.
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: Why do RAR files stink?

Post by qw »

All right, maybe Combuster has something to add, but I think I have my answer.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Why do RAR files stink?

Post by Solar »

You're trying to poke fun at me, right?
turdus wrote:Well, pkzip is officially not supported on unices, it's eol.
Pkzip is an utility, not a format.
As for compatiblity it's approval for being a Standard was denied.
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.
If you really want to go for maximum compatiblity, you should choose portable archive...
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.
With zip you'll never archive your root linux partition without loss of information for example.
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...
Additionally, ZIP archives can be "browsed" just like another folder. TAR archives don't allow that.
Don't know what you're talking about. No such limitation of the format itself.
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...
For example I work with mainframes and unices for living, there nobody uses zip. Never ever.
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.

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.

ZIP compression is not good, there are many things it doesn't support properly, and it does require additional installation of an unpacker on some platforms. But no other archive format has a bigger installed support base, and an extractor at arm's reach for as many platforms, that is all I claim.
Every good solution is obvious once you've found it.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Why do RAR files stink?

Post by Love4Boobies »

I accept the challenge of compressing your files at 10% or less of their original size in order to show off my awesome data compressor. I will send you the compressed file and a decompressor so that you may verify.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Why do RAR files stink?

Post by Love4Boobies »

No. For instance, I just tried both algorithms on a JPEG image of 3,153,188 bytes. LZMA got me 248,207 bytes, while my algorithm got me 220,825 bytes. So I'm doing only slightly better in this case---sometimes the results are much better but I don't want to do false/misleading advertisments :)

Warning: Will edit this post in a bit.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Why do RAR files stink?

Post by Combuster »

Hobbes wrote:I would like to know what makes you say that.
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.

Nevertheless seeing a pageful means successful troll is successful. muhaha. :twisted:
Last edited by Combuster on Wed Mar 07, 2012 11:36 am, edited 1 time in total.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: Why do RAR files stink?

Post by turdus »

@Solar: about utility and file format: if you don't have the utility you cannot deal with the format, am I right?
I also wouldn't require maximum ease of portability from such an archive, now would I?
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
Hmm, seems contradiction.
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...
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.
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.
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.
...no other archive format has a bigger installed support base...
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.

Hell, it's so f*cking simple, I can write a tar.gz unpacker for you in ~20 lines:

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);
}
You get the point. Simplicity is a great friend of porting. (That's true I was cheating by using zlib).
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Why do RAR files stink?

Post by Solar »

Now I know you're pulling my tail.
turdus wrote:@Solar: about utility and file format: if you don't have the utility you cannot deal with the format, am I right?
I don't need the utilities 'pkzip' or 'WinZip' to create or extract ZIP files. In fact, I don't think I ever have.
I also wouldn't require maximum ease of portability from such an archive, now would I?
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
Hmm, seems contradiction.
But you did read what I wrote, huh?

If I am packing a couple of files for distribution, as in "PDCLib source tree", or "my TeX project", or "pics from my party last night", system-specific stuff like file owner, last access time or permission flags don't matter.

If I am packing my Linux root directory with a mind to preserve flags, time stamps and ownerships, I am implying that I intend to unpack this on another Linux (or, at least, Unix) machine, since the additional things in the archive don't make sense on other platforms anyway.
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.
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.
...no other archive format has a bigger installed support base...
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.
*sigh*

As I said, .tar.gz is the #2 contender, so of course it is not bad in that regard. But last time I looked, you couldn't open a .tar.gz as a folder in Windows Explorer, for example.
I'm saying, tar is more than a decade older and much much simplier...
...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.

You might hate Windows all you want, but you should not ignore it.
Hell, it's so f*cking simple, I can write a tar.gz unpacker for you in ~20 lines...
Yep, you're cool. Actually posting the code, however, was a bit juvenile, don't you think?
Every good solution is obvious once you've found it.
Locked