On May 16, 2005, at 18:30, Jonas Melian wrote:
> To knowing if a directory isn't empty, I use:
>
> dir_example = "/usr/foo/"
>
> if glob.glob(os.path.join(dir_example, "*")):
> ...
>
>
> But, as it has to expand all files, i'm supposed that it's a little
> slow
> to simply knowing if a dire
To knowing if a directory isn't empty, I use:
dir_example = "/usr/foo/"
if glob.glob(os.path.join(dir_example, "*")):
...
But, as it has to expand all files, i'm supposed that it's a little slow
to simply knowing if a directory is empty.
Any improvement?
___