I first used
ofstream f("path",ios::out | ios::trunc | ios::binary );
for writing new data into it But,Guess what ? in recovery app