D
David Walker
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);
}
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);
}