Perseverance pays off.

Solution to checking if a file exists is to store result in a variable before
it gets converted:

$result = sprintf("%s", $t->cmd("test -f $testFile && print 1 || print 0"));

Note:  None of the following worked:
$result = ! $t->cmd( "test -f $testFile ; echo $?" );
$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");

(this still doesn't make sense to me)

-JW

__________________________________________________
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