Tar on Windows XP
- From: "David Walker" <david@xxxxxxxxxxx>
- Date: Mon, 29 Jan 2007 22:27:50 GMT
Hi
I am trying to create a tar archive on Windows XP with the Perl code below.
However, when I look at the archive created (using WinZip 10.0) all the
directory information is lost, and when I untar it using WinZip all I get is
all the files in the same directory. Can some kind person please tell me how
I can create the tar file so that when it is untar'd the directory
structure will be preserved.
Thanks
David
use Archive::Tar;
use IO::Zlib;
use File::Find;
$dir = "c:/docume~1/david/somedir";
$archive = "c:/docume~1/david/archive.tar";
$tar = Archive::Tar->new;
(@files);
find(\&wanted, $dir);
$tar->add_files(@files);
$tar->write($archive);
sub wanted{
push(@files,$File::Find::name);
}
.
- Follow-Ups:
- Re: Tar on Windows XP
- From: Sisyphus
- Re: Tar on Windows XP
- Prev by Date: Re: Style questions
- Next by Date: Re: html tags and perl
- Previous by thread: FAQ 3.20 How can I hide the source for my Perl program?
- Next by thread: Re: Tar on Windows XP
- Index(es):
Relevant Pages
|
|