[SOLVED]how to check whether a Dir is empty or not?
-
how to check whether a Dir is empty or not?
thank you -
QDir("/PATH/TO/DIR").count()
Returns 2 for empty directories ("." and ".." are counted). -
@jsulm is this always true? in every platform include windows, mac, linux?
-
I tested on Linux and Windows: it returns 2 for empty directories. Since MacOS X is a UNIX like system it behaves same there for sure.
-
@jsulm thank you very much