vaibhavbajpai
asked on
Cannot open dir for a remote location using the perl script
Iam trying to execute a perl script from an ant xml , which would open the directory in the remote location and extract some files. However Iam able to execute the saem script from command line .
The command line works fine as
C:\>perl C:\ICE\scripts\htmlpagesun zip\search _propertie s.pl \\sjc-filer01.corp.ebay.co m\eb_dcpc\ v4html_pag es C:\ICE\temp\instance1/v4ht ml
Iam using perl version 5.8.4 from Active Site and I have confirmed that .pl is one if the allowed extensions defined in the IIS Server configurations
C:\Perl\bin\Perl.exe %s %s
The command line works fine as
C:\>perl C:\ICE\scripts\htmlpagesun
Iam using perl version 5.8.4 from Active Site and I have confirmed that .pl is one if the allowed extensions defined in the IIS Server configurations
C:\Perl\bin\Perl.exe %s %s
The ant xml snippet
<exec executable="perl" failonerror="true" timeout="800000">
<arg line="${global.script.dir}\htmlpagesunzip\search_properties.pl \\sjc-filer01.corp.ebay.com\eb_dcpc\v4html_pages ${global.temp.dir}\v4html"/>
</exec>
I get error as
[exec] Can't opendir(\\sjc-filer01.corp.ebay.com\eb_dcpc\v4html_pages): Invalid argument
[exec] at C:\ICE\scripts\htmlpagesunzip\search_properties.pl line 12
The perl script contents for search_properties.pl
#ICE/config/scripts/htmlpagesunzip
# This file is used to create a back up of all the build.properties files.
use strict;
use warnings;
use File::Find;
use File::Copy;
# change these assignments as needed
my ($srcdir,$destdir);
$srcdir = $ARGV[0];
$destdir = $ARGV[1];
finddepth(\&wanted,$srcdir);
sub wanted {
return if -d;
if($File::Find::name =~ /^.+build.properties$/) {
my $file = $File::Find::name ;
#get the subfolder containing the file
my $subdir=$1 if($file=~/\/([^\/]+)\/[^\/]+\.properties$/);
my $dest = $destdir.$subdir;
mkdir($dest) unless(-e $dest); # create the folder-structure
copy($file, "$dest") or warn "$!";
}
}
Sounds like the privileges Ant is running with doesn't have access to the directory, where as the rights of the user running the command line does have the privilege.
ASKER
How would I set the priveledges in Ant for executing the remote access ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.