directory search and compare