Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to count number of files in a folder

How to count number of files in a folder

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    santhoshv84
    wrote on last edited by
    #1

    Hi Friends, Could any one tell me, How to count number of files in a folder. Ex: C:\My Documents\New Folder I need to count all the files in this path.

    Thanks and Regards. SANTHOSH V

    K 1 Reply Last reply
    0
    • S santhoshv84

      Hi Friends, Could any one tell me, How to count number of files in a folder. Ex: C:\My Documents\New Folder I need to count all the files in this path.

      Thanks and Regards. SANTHOSH V

      K Offline
      K Offline
      kcynic
      wrote on last edited by
      #2

      you can use _findfirst() and _findnext(). The second function use the return value of the first function to retrieve. You can see more details in MSDN. But you should pay attention to the two found results,whose name is "." and "..",they are the current folder and its parent folder! You can test in MS-DOS.

      S 1 Reply Last reply
      0
      • K kcynic

        you can use _findfirst() and _findnext(). The second function use the return value of the first function to retrieve. You can see more details in MSDN. But you should pay attention to the two found results,whose name is "." and "..",they are the current folder and its parent folder! You can test in MS-DOS.

        S Offline
        S Offline
        santhoshv84
        wrote on last edited by
        #3

        Thank you friend, This _findfirst() and _findnext() helped me solve this problem. Thanks a lot once again.

        Thanks and Regards. SANTHOSH V

        H 1 Reply Last reply
        0
        • S santhoshv84

          Thank you friend, This _findfirst() and _findnext() helped me solve this problem. Thanks a lot once again.

          Thanks and Regards. SANTHOSH V

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          If you are using DlgDirList you can get count of files.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups