Need to use our own temp files as we cannot rely on pwd