Opening the result file in write with  truncation mode