-
September 23rd, 2011, 09:10 AM
#1
List out all the files in a folder
Could anyone tell me how to list out all the files in a folder?
e.g. if I want to extract all the .jpeg files from a folder, how do i go about it?
Any help would be appreciated.
Thanks
-
September 23rd, 2011, 09:22 AM
#2
Re: List out all the files in a folder
The CFileFind-class (of MFC) might be aqppropriate.
-
September 23rd, 2011, 09:27 AM
#3
Re: List out all the files in a folder
It's OS-specific, unless you use a cross-platform library like Boost.Filesystem. What OS are you on?
-
September 23rd, 2011, 09:58 AM
#4
Re: List out all the files in a folder
I am using Windows although I would be happy to port to Linux too.
And is there some Non-MFC alternative?
Thanks
-
September 23rd, 2011, 10:11 AM
#5
Re: List out all the files in a folder
Look up FindFirstFile and FindNextFile on MSDN.
-
September 23rd, 2011, 11:20 AM
#6
Re: List out all the files in a folder
Thanks A Lot!
Although ,it does not search directory within a directory.
-
September 23rd, 2011, 11:45 AM
#7
Re: List out all the files in a folder
Originally Posted by vinayak4gargya
Thanks A Lot!
Although ,it does not search directory within a directory.
It does if you call it recursively. There are examples in the FAQ.
-
September 23rd, 2011, 12:30 PM
#8
Re: List out all the files in a folder
Yep got it!
Supposed to AND FileAttributes with FILE_ATTRIBUTE_DIRECTORY
Thanks a bunch
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
|