detect root directory in path2key