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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chanshaw
    New Member
    • Nov 2008
    • 67

    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.

    Code:
    	if (-e $filename)
    	{
    		print "File Doesn't Exist!";
    	}
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    Your example is logically reversed, it should be:

    Code:
        if (-e $filename)
        {
            print "File Exists!";
        }

    -e works on Windows.

    Comment

    Working...