function IncludeSearchSDS(const Path: string): string;
begin
result := path;
if IsPathDelimiter(Result, Length(Result)) then
Result := Result + '*.*'
else
Result := Result + PathDelim + '*.*';
end;
function IsEmptyDirectory(const Path: String): boolean;
var
SR : TSearchRec;
C : integer;
begin
result := true;
C := 0;
if DirectoryExists(Path) then
if SysUtils.FindFirst(IncludeSearchSDS(Path), faAnyFile, SR) = 0 then
try
repeat
if (SR.Name <> '.') and (SR.Name <> '..') then
inc(C);
until (SysUtils.FindNext(SR) <> 0) or (C > 0);
result := C = 0;
finally
SysUtils.FindClose(SR);
end;
end;