Share the directory finding code.