Teddy,
    Try:
if (-e "/usr/www/domain/file.txt"){
    print "file.txt exists\n";
}

A few others are -f to check if it is an ordinary file, -d to find if it exists and is 
a
directory, -l to find if it exists and is a symlink, -T to find if it exists and is a 
plain text
file.  There are about 20 others.  Look up "file test operators" some time.

Regards,
David


----- Original Message -----
From: "Octavian Rasnita" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 28, 2002 5:37 AM
Subject: Verifying the existence of a file


Hi all,

I want to verify if a file exists using the head method of LWP::Simple.
I don't know why, but some servers don't allow using this method and I think
I need using the get method instead.

Do you know if using the get method for a file means in fact reading all the
file?

I want to check if a file exists but I don't want my script to lose the time
reading all the file because some files (archives, etc) might be very big.

Can you give me a hint what module/method should I use?

Thanks.


Teddy Center: http://teddy.fcc.ro/
Mail: [EMAIL PROTECTED]



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



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

Reply via email to