The code above uses the raw Win32 API to search for files in a particular directory. FindFirstFile() coupled with FindNextFile() will return all text files ( as denoted by the *.txt wildcard ) in the C:\TempHold folder on my disk. You can change this wildcard to a filename to search for that file in the folder. If that file is not in the directory in question, then "Invalid File Handle" will be displayed on the console. Mike L.G.
mlg400@blazemail.com
I forgot to mention that there is also alot of information that you can extract from the handle that you pass to FindFirstFile(),FindNextFile() i.e. creation time,alternate file name, file size etc... Mike L.G.
mlg400@blazemail.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.