cli: added missing O_TRUNC to os.open