add atomic3, truncation happens before writing.