command function and write file function and interface function