469,277 Members | 2,206 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,277 developers. It's quick & easy.

Check to see if file exsists (perl running on vista)

Hey I'm trying to see if a file exsists but I'm using windows, I know in Linux you can use -e but that doesn't seem to work for me in windows.

Expand|Select|Wrap|Line Numbers
  1.     if (-e $filename)
  2.     {
  3.         print "File Doesn't Exist!";
  4.     }     
  5.  
Mar 10 '09 #1
1 2004
KevinADC
4,059 Expert 2GB
Your example is logically reversed, it should be:

Expand|Select|Wrap|Line Numbers
  1.  
  2.     if (-e $filename)
  3.     {
  4.         print "File Exists!";
  5.     }     
  6.  

-e works on Windows.
Mar 10 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Pierre-Yves | last post: by
3 posts views Thread by Jason Miles | last post: by
1 post views Thread by Christina | last post: by
1 post views Thread by Harry | last post: by
14 posts views Thread by Martin Wells | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.