Infrastructure for current directory handling