in reply to Lightweight, Platform-Independant Tar

I installed GNU Tar for Windows from Sourceforge and it works great from the command line. However, when I try to call it from within a simple Perl script I get an error that appears to be saying GNU Tar cannot create the Tar file. Below is the code and the result. Any ideas?

C:\Temp>type tartest.pl
use strict;

$ENV{MYTAR} = "c:\\Progra~1\\GnuWin32\\bin\\tar.exe";

my ($wrkPath, $testDir);

$wrkPath = "c:\\temp\\playtar.tar";
$testDir="c:\\temp\\test";

chdir($testDir);

if (system("$ENV{MYTAR} cf $wrkPath .")) {
print "***Error Tar-ing\n";
}
else {
print "Tar successful\n";
}

exit (0);

C:\Temp>
C:\Temp>perl -c tartest.pl
tartest.pl syntax OK

C:\Temp>perl -w tartest.pl
c:\Progra~1\GnuWin32\bin\tar.exe: Cannot open c:\temp\playtar.tar: Function not implemented
c:\Progra~1\GnuWin32\bin\tar.exe: Error is not recoverable: exiting now
***Error Tar-ing
C:\Temp>
  • Comment on Re: Lightweight, Platform-Independant Tar