Hi Guys
Simple but annoying problem.
How do I test to see if a particular file exists on the server? OPEN does a sort of test but creates the file if it doesn't exist.
Thanks
Keith
Yes, there are a number of file test operators - -w for a writeable file, -r for readable and so on. No doubt there's a complete list somewhere in the perl documentation.
Thanks for the replies.
Are these just command line switches or are they script based. My problem is that I am asking the questions from work so have no way of testing.
I am writing a Shopping Cart and each product has its own small picture. Some of the products have enlarged pictures which have the same name as the small pictures but reside in a different directory.
All I want to check for is the existence of a picture in the "large pic" directory. Other laguages I program have a specific 'EXIST' command or something similar.
Thanks
Keith
To expand slightly the file operators are generally unary boolean operators. i.e. they take a single argument (a scalar which evaluates to a filename or filehandle) and return true or false.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.