Cannot open dir for a remote location using the perl script

Posted on 2008-11-06
Last Modified: 2013-11-10
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\ \\\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\ \\\eb_dcpc\v4html_pages ${global.temp.dir}\v4html"/>


I get error as 

[exec] Can't opendir(\\\eb_dcpc\v4html_pages): Invalid argument

     [exec]  at C:\ICE\scripts\htmlpagesunzip\ line 12

The perl script contents for


# This file is used to create a back up of all the 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 =~ /^$/) {

 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

Question by:vaibhavbajpai
    LVL 16

    Expert Comment

    by:Bryan Butler
    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.

    Author Comment

    How would I set the priveledges in Ant for executing the remote access  ?
    LVL 16

    Accepted Solution

    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:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (,  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
    How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from ( Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
    The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
    The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now