open()read()/write()close()open - 打開或創建文件ssize_t read(int fd, void *buf, size_t count);
fd:文件描述符。buf:緩衝區地址。count:請求讀取字節數。errno。write - 向文件寫入int close(int fd);
open,創建文件用三參數版(需O_CREAT)。|,如O_WRONLY | O_CREAT | O_TRUNC。perror並釋放資源。