develooper Front page | perl.beginners | Postings from March 2002

checking if file exists on remote machine...

Thread Next
From:
Randy Brown
Date:
March 29, 2002 23:42
Subject:
checking if file exists on remote machine...
Message ID:
B4B86640A5C3854C8B4003F0C524F2C23159D0@cmimail2.amdocs.com
I'm trying to check if a file exists on a remote machine using perl.  I am unable to make this work.  Anyone have any suggestions?

Thanks!

Randy


       #       if source files not there, error
        $length=@source_file;
        $counter=0;
        print "\n\n";
        while ($counter < $length)
        {

        #print "\nCHECKING REMSH\n";



                $pcommand="remsh $source_machine -l username -n ls $source_file[$counter] 2>/dev/null;";

                if (  `$pcommand` !~ "$source_file[$counter]" )
                {print "\n >>> COULD NOT FIND SOURCE FILE>>> $source_machine[$counter]:$source_file[$counter]\n\n\n";exit;}

                $counter++;
        } 

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About