fileutils: check if directory exist before search