We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

checking existance of files

hess
hess asked
on
Medium Priority
135 Views
Last Modified: 2010-04-30
How would I go about seeing if a file exists?
Comment
Watch Question

Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Commented:
You can check if a file exists with a simple Dir command.
If the result is empty .. The file doesn't exist.
Another way is to check it's attributes using the getattr function.

Author

Commented:
Thank You I was unaware of the dir function. Before i had been trying to use the on error statement and perposely cause errors but that wasn't behaveing nicely.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.