|
-
July 27th, 2009, 12:55 PM
#1
Search for files using their formats
Hi and greeting to all
I have a small problem and i hope someone can help me through ur fruitful forums here, and please excuse my weak language.
I need to design a program that has some functionality intends to search for files using their formats. I have been advised to use the C++ WinAPI to be able using some function from Windows.
I do need any help to make the program search for all files that has the .INI format, as an example. After gathering these files i need them somehow to process some operations on them that i will handle later.
I appreciate ur cooperation.
My kind regards..
-
July 27th, 2009, 03:04 PM
#2
Re: Search for files using their formats
The MSDN samples show how to use FindFirstFile and FindNextFile (and they have an "ex" version, too).
These allow you to supply wildcards to the search term, as in "*.ini".
The use of these is recursive, and I believe at least one sample shows that. In other words, when you get an entry and discover it is a directory, not a file, you'll perform a recursive search in that directory, continuing recursively in a fashion that searches all directories and subdirectories on a drive.
If you need to search all drives, you'll also need to search "getdrives" - it's a little uncomfortable at first, but it will reveal all of the drives on the system. You'll need to search each drive if "all drives" is your target interest.
If my post was interesting or helpful, perhaps you would consider clicking the 'rate this post' to let me know (middle icon of the group in the upper right of the post).
-
August 4th, 2009, 11:58 PM
#3
Re: Search for files using their formats
This FAQ might help.
Cheers
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|