Know if a directory is empty  

Send By: Christian Engstfeld
Web : www.PlanetSoftware.8k.com
Email: Christian.Engstfeld@inworx.com.ar
Date: 21/02/02

Tip accessed 480 times

 



 function IsDirEmpty (const ADirPath :string) :boolean;
 var F :TSearchRec;
 begin
   result := (FindFirst(ADirPath+'\*.*',faAnyFile,F) = 0) and
             (FindNext(F) = 0) and
             (FindNext(F) <> 0);
   FindClose(F);
 end;