Support smart dir functions.