adds option to check file system first.

improves logic to take directories that start with a dot into account.