Try using getcwd instead.