Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking files in a directory

Status
Not open for further replies.

AtariJag64

Programmer
Mar 4, 2002
8
US
I'm trying to monitor a directory to ensure that all of the files are there.

The files are being processed by another program, so I need to verify that all 4 files are present before moving on.

Does anyone know a way to do this?

I've tried to install a File System Watcher, but I didn't find a method to look for specific files.

Any suggestions?

Thanks,
Chris
 
If you're looking for the existence of specific files, not for changes in the file system, then the FileSystemWatcher is the wrong piece to use.

I don't have my work system with me, but I believe you want to check in System.IO under the Directory object for the GetFiles method, and look through that collection to see if the files of interest exist. I think there's also a File object with an Exists method.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top