write to file in progress