|
<article data-content="[{"type":"block","id":"udLY-1669117563986","name":"code","data":{"wrap":false,"version":1,"language":"","theme":"default"},"nodes":[{"type":"block","id":"UsmE-1669117563985","name":"code-line","data":{},"nodes":[{"type":"text","id":"khqk-1669117077774","leaves":[{"text":"头文件:","marks":[]}]}]},{"type":"block","id":"ONCq-1669117566710","name":"code-line","data":{},"nodes":[{"type":"text","id":"lvJR-1669117566709","leaves":[{"text":" #include ","marks":[]}]}]},{"type":"block","id":"iGIc-1669117571721","name":"code-line","data":{},"nodes":[{"type":"text","id":"gS2L-1669117571719","leaves":[{"text":"函数原型:","marks":[]}]}]},{"type":"block","id":"voWk-1669117566981","name":"code-line","data":{},"nodes":[{"type":"text","id":"z1xi-1669117566980","leaves":[{"text":" int close(int fd);\r","marks":[]}]}]},{"type":"block","id":"UmjX-1669117566983","name":"code-line","data":{},"nodes":[{"type":"text","id":"Ul2E-1669117566982","leaves":[{"text":"参数:","marks":[]}]}]},{"type":"block","id":"w33h-1669117579611","name":"code-line","data":{},"nodes":[{"type":"text","id":"le9Z-1669117579609","leaves":[{"text":" fd:想要关闭的文件的描述符","marks":[]}]}]},{"type":"block","id":"20Ce-1669117595204","name":"code-line","data":{},"nodes":[{"type":"text","id":"XDLm-1669117595202","leaves":[{"text":"返回值:","marks":[]}]}]},{"type":"block","id":"piJl-1669117605862","name":"code-line","data":{},"nodes":[{"type":"text","id":"QD24-1669117605860","leaves":[{"text":" 成功:返回0","marks":[]}]}]},{"type":"block","id":"WjxN-1669117654576","name":"code-line","data":{},"nodes":[{"type":"text","id":"Av8i-1669117654575","leaves":[{"text":" 失败:返回-1","marks":[]}]}]}],"state":{}}]">什么是文件IO:对文件进行输入输出的操作
文件:linux下一切皆文件
I : input 输入
O: output 输出
open 打开
close 关闭
write 写入
read 读取
头文件: #include <unistd.h>函数原型: int close(int fd);参数: fd:想要关闭的文件的描述符返回值: 成功:返回0 失败:返回-1
|
|