471,888 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,888 software developers and data experts.

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 2077
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
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.