Gentoo Archives: gentoo-user

From: Matt Randolph <mattr@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Compression tools Compared
Date: Wed, 17 Aug 2005 04:57:57
Message-Id: 4302C2B1.5030709@erols.com
In Reply to: Re: [gentoo-user] Compression tools Compared by Matt Randolph
1 Matt Randolph wrote:
2
3 > Matt Randolph wrote:
4 >
5 >>
6 >> This may be a case of a different paradigm being used by 7-zip than
7 >> that used by traditional (*nix) compression tools. If my memory
8 >> serves me, the 7-zip format is very similar to the pkzip format in
9 >> its usage. By that I mean that one is not required to make a tarball
10 >> before compressing multiple files. The format allows you to skip the
11 >> tar step and make an archive consisting of whichever files and
12 >> directories you wish.
13 >>
14 >> The problem, I'm guessing, is that the 7-zip archive format was
15 >> developed in the Windows world where users and groups and permissions
16 >> have no meaning (I think that has changed or is changing in the NT/XP
17 >> world, but I don't know and don't especially care). Hence, these
18 >> attributes aren't accomodated by this format. I assume the 7-zip
19 >> extractor program sets the user and group of the extracted files to
20 >> that of whomever extracts them.
21 >>
22 >> What everyone has rightly pointed out, namely that you can make a
23 >> tarball and then compress that, is exactly right. That IS how one
24 >> would use 7-zip with a proper operating system.
25 >>
26 >> The original poster most likely used the 7-zip archiver as a
27 >> stand-alone tool, rather than using it in conjunction with tar. This
28 >> is not altogether surprising as one typically compresses a directory
29 >> with a single tar command (and an implied pipe) rather than
30 >> explicitly piping the output of tar to the compression utility.
31 >> Since there is no --7-zip switch in tar, the OP couldn't simply 'tar
32 >> -7cf backup.tar.7zip lib/'. The OP probably simply 7-zipped his
33 >> directory without tarring it first and consequently ran into the
34 >> limitations of the archive format.
35 >>
36 > "-rw-r--r-- 1 root root 3536665 Aug 13 00:01 backup.tar.7z"
37 >
38 > Oops! I should read more carefully.
39 >
40
41 In an effort to put this matter to rest (and to save a little face), I
42 have tested 7-zip.
43
44 I created a directory containing two empty files. These files were then
45 assigned arbitrary users and groups. Next I created a tarball of the
46 directory. I changed the ownership of the tarball too. Finally, I
47 7-zipped the tarball.
48
49 When I extracted the tarball it was given the user and group of the
50 extractor (eg. myusername:users) rather than what it was assigned
51 above. When I untarred the tarball, however, the contents were exactly
52 as you would expect; they had the user and group settings that I
53 assigned them previously.
54
55 I once again feel that my original hypothesis is essentially correct.
56 7-zip doesn't support user, group and permission data because it was
57 originally developed for Windows. But this is a limitation that can be
58 worked around by making a tarball first. The OP noticed that the
59 ownership and permissions of the tarball changed and made a comment
60 about that. This fact has little relevance for most users since we will
61 only care about the contents of the tarball, not the tarball itself.
62
63 --
64 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Compression tools Compared Neil Bothwick <neil@××××××××××.uk>