Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 127
  • Last Modified:

checking existance of files

How would I go about seeing if a file exists?
0
hess
Asked:
hess
  • 2
1 Solution
 
dr00pyCommented:
You can check if a file exists with a simple Dir command.
If the result is empty .. The file doesn't exist.

0
 
dr00pyCommented:
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.

0
 
hessAuthor 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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now