memoized directory lookup