943,926 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2531
  • C++ RSS
Jul 30th, 2007
0

regarding directory structure

Expand Post »
Hi,

I have a small question.
How do I compute the number of files(which are specific such as .doc) in a directory in C++.

For example, if I have 10 files of type .doc format in a directory, how do I compute this value using C++.

Any help is appreciated.

Thanks!!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
flavour_of_bru is offline Offline
11 posts
since Jun 2007
Jul 30th, 2007
0

Re: regarding directory structure

depends on the operating system. MS-Windows you can use FindFirstFile() and FindNextFile(). *nix you can use opendir() and readdir(). Or boost libraries have a functions that are portable between operating systems. You can find c++ examples of both in the c++ code snippets here at DaniWeb.
Last edited by Ancient Dragon; Jul 30th, 2007 at 7:41 pm.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Reading numbers into an array
Next Thread in C++ Forum Timeline: The best way to render in Direct3D 9





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC