Is folder empty ??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Raju2k
    New Member
    • Jul 2006
    • 1

    #1

    Is folder empty ??

    How can we find whether the folder is empty or not ??
    Is there a single function for it, provided by c++ library ??
  • Ashish_CPP
    New Member
    • Jul 2006
    • 35

    #2
    Originally posted by Raju2k
    How can we find whether the folder is empty or not ??
    Is there a single function for it, provided by c++ library ??

    Hi,
    U can use the function FindFirstFile( ); which will try to find the first file present in the given folder n if the folder is empty then this function will fail.

    Comment

    • Banfa
      Recognized Expert Expert
      • Feb 2006
      • 9067

      #3
      No folder is empty every folder always contains the directories

      .
      ..

      that is dot and dot dot representing the current folder and the folder 1 level down in the directory structure. remembering that directories are just a special type of file.

      You may be able to tell FindFirstFile to ignore directory files or you may have to read the contents of the directory and ignore these 2 entries.

      Comment

      Working...