About Store Forum Documentation Contact
Donations:
345$/mo



Post Reply 
Detecting Directory Contents
Author Message
Driklyn Offline
Member

Post: #1
Detecting Directory Contents
Is there a built-in function for detecting if a directory is empty? The closest I can find is FAll(), but I'd rather be able to use something like "if (FDirEmpty(dir))".
(This post was last modified: 06-16-2011 12:38 AM by Driklyn.)
06-16-2011 12:35 AM
Find all posts by this user Quote this message in a reply
Mardok Offline
Member

Post: #2
RE: Detecting Directory Contents
Bool FDelDir (Str name ); // delete empty directory, false on fail

It will be usefull for you?

FALSE on fail, so you can check if something is inside.
06-16-2011 12:45 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #3
RE: Detecting Directory Contents
Hmm... I suppose that's one way to do it, lol smile ... I'll probably have to recreate the directory since it'll get deleted if it is indeed empty, but I guess that's no big deal.

Thanks for the idea!
(This post was last modified: 06-16-2011 12:52 AM by Driklyn.)
06-16-2011 12:52 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #4
RE: Detecting Directory Contents
FileFind ff(dir); if(ff())not empty
06-16-2011 05:05 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #5
RE: Detecting Directory Contents
Thanks. I saw FileFind in the Header Browser tool but wasn't sure how to use it or if it would work on directories.
06-17-2011 01:41 AM
Find all posts by this user Quote this message in a reply
Post Reply