platform independent determination of currentDir