Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 125
  • 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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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