468,512 Members | 1,485 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

Is folder empty ??

1
How can we find whether the folder is empty or not ??
Is there a single function for it, provided by c++ library ??
Jul 31 '06 #1
2 5193
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.
Jul 31 '06 #2
Banfa
9,056 Expert Mod 8TB
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.
Jul 31 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by atse | last post: by
2 posts views Thread by atse | last post: by
1 post views Thread by Keith | last post: by
5 posts views Thread by Lucas Ponzo | last post: by
13 posts views Thread by could ildg | last post: by
1 post views Thread by Pmcg | last post: by
6 posts views Thread by lumpybanana247 | last post: by
24 posts views Thread by biganthony via AccessMonster.com | last post: by
1 post views Thread by Larry Bates | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.