check a folder can be readen before getting files out of it.
This avoid the "is not a directory" exception