Execute command must wait until file is finished writing