• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1149
  • Last Modified:

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\htmlpagesunzip\search_properties.pl \\sjc-filer01.corp.ebay.com\eb_dcpc\v4html_pages  C:\ICE\temp\instance1/v4html

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"/>
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
# 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];
 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 "$!";

Open in new window

  • 2
1 Solution
Bryan ButlerCommented:
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.
vaibhavbajpaiAuthor Commented:
How would I set the priveledges in Ant for executing the remote access  ?
Bryan ButlerCommented:
I'm not sure.  I believe that's the tricky thing if you are talking distributed builds.  There's a bunch tool I see for doing this, with one of the free ones being:


These are more for "distributed" building than "remote" building, but it might be what you need.  Here's an article on it:


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now