[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cgi-list
Subject:    RE: [CGI] OFF TOPIC: TAR
From:       "Neil Lunn" <NeilLunn () bigpond ! com>
Date:       1998-06-23 0:31:09
[Download RAW message or body]

Jann,

Bob Skinner wrote:

>If you want to add the file to the tar, then you'd have to un-tar it and
>re-compress with the new file in it. If what you want to do is create a
>new .zip with the tar file and the new file both in it, then pkzip (or
>winzip) will do it; just create new zip, and add to zip...

What is this? Windoze day out! (I say as I write this from an NT
Workstation. But at least it's attached to an AIX Server)

For the real question:

>
> Jann Linder wrote:
>
> > how do i replace 1 file in a tar file.
> >
> > for instance.  I have a file /c.tar.zip  and a file
> /home/jann/calendar.pl
> >
> > I want to put calendar.pl into /c.tar.zip

Good old plain vanilla tar, this should be simple enough!

-u      Adds the files specified by one or more File parameters to the
end of the archive only if the files are not in the archive already,
or if they have been modified since being written to the archive.
The -u flag is not valid for any tape devices because such devices
do not support the addition of information at the end of a tape.

Groovy enough for ya!

The only question, is this the GNU tar that does gzip compression (have a
version from Win32-Unix project but not using it yet) or are you using zip
for the more conventional use of the .zip extension?

The windoze user is right. The -u option also with zip will update and add
files. But if you're zipping a .tar you have to unpack the .tar and update
it seperately. Because of this I typically only use a .tar when I need to
keep an ACL. For sheer compression a gzipped tar usually takes up the least
space. Slightly better than a zipped tar, which is slightly better than a
plain zip.

Cheers,

Neil
                                          \\\|///
                                          | ~ ~ |
                                         (- o o -)
 =====================================oOOOo=(_)=oOOOo=======
| Neil Lunn, Systems Manager, Rudolf Gunz Companies         |
| E-mail: mailto:NeilLunn@bigpond.com                       |
| Voice: 61 2 9935 6614                                     |
| Fax:   61 2 9935 6620                                     |
| Snail Mail:  Locked Bag 690                               |
|              Beaconsfield NSW 2014                        |
|              Australia                                    |
|                                               Oooo        |
 =======================================oooO====(  )========
                                        (  )    ) /
                                         \ (   (_/
                                          \_)










-----------------------------------------------------------------
For subscription information, http://www.jann.com/lwgate/lwgate.pl/CGI-LIST/.

The CGI Tips & Tricks website (and archive of the list) is located
at http://www.jann.com/Perl/

cgi-list is hosted by Wizards of the Web (http://wizweb.com).
-----------------------------------------------------------------

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic