Added O_TRUNC to file open.