Writing the status of an execution in a file