How do you check if a file exists on a remote server using Net::Telnet ?

I have tried:

$testFile = "/tmp/noFileExistsHere";

$result = $t->cmd("test -f $testFile ; print $? ");
$result = $t->cmd("test -f $testFile && print 1 || print 0");
$result = $t->cmd("if [ -f $testFile ] ;then print 1; else print 0; fi");

and $result ALWAYS contains 1.

The only way I can think of is:

$result = $t->cmd("ls -l $testFile");

then checking $result for an error message.  

Any better solutions?


Jeff





__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to