#粤嵌星计划,粤嵌我来了#
第十六次打卡,今天分享文件读写位置的函数及其参数
off_t lseek(int fd, off_t offset, int whence);
fd==> 要调整位置偏移量的文件的描述符
offset ==> 新位置偏移量相对基准点的偏移
whence ==> 基准点
-- SEEK_SET ==> 文件开头处
SEEK_CUR ==> 当前位置
SEEK_END ==> 文件末尾初
返回值 新文件位置偏移量 ==> 成功
-1 ==> 失败
关键点:
1、lseek函数可以将文件位置调整到任意的位置,可以是已有数据的地方,也可以是未有数据的地方,假设调整到文件末尾之后的某个地方,那么文件将会形成所谓“空洞”。
2、lseek函数只能对普通文件调整文件位置,不能对管道文件调整。
3、lseek函数的返回值是调整后的文件位置距离文件开头的偏移量,单位是字节。
第十六次打卡,今天分享文件读写位置的函数及其参数
off_t lseek(int fd, off_t offset, int whence);
fd==> 要调整位置偏移量的文件的描述符
offset ==> 新位置偏移量相对基准点的偏移
whence ==> 基准点
-- SEEK_SET ==> 文件开头处
SEEK_CUR ==> 当前位置
SEEK_END ==> 文件末尾初
返回值 新文件位置偏移量 ==> 成功
-1 ==> 失败
关键点:
1、lseek函数可以将文件位置调整到任意的位置,可以是已有数据的地方,也可以是未有数据的地方,假设调整到文件末尾之后的某个地方,那么文件将会形成所谓“空洞”。
2、lseek函数只能对普通文件调整文件位置,不能对管道文件调整。
3、lseek函数的返回值是调整后的文件位置距离文件开头的偏移量,单位是字节。
#像极了做英语试卷时的我#
生物工艺学
商务用语 biotechnology applied in agriculture
生物工程在农业中的应用
经典例句 The first round, which was concluded in September, awarded$126 million over five years to three projects, which seek to develop information technology, biotechnology, and economics and business strategy as areas of excellence in three UGC-funded institutions.
生物工艺学
商务用语 biotechnology applied in agriculture
生物工程在农业中的应用
经典例句 The first round, which was concluded in September, awarded$126 million over five years to three projects, which seek to develop information technology, biotechnology, and economics and business strategy as areas of excellence in three UGC-funded institutions.
Only when there are no impure thoughts in your mind can you discern your true nature. To seek one's true nature while still enmeshed in erroneous thoughts is like disturbing the surface of the water while trying to see the moon's reflection. When all thoughts are pure, the heart then becomes clear. Without ousting the worldly concerns that afflict the mind, not only will it be vain to seek one's true nature, it will make that nature even more obscure. 心虚则性现,不息心而求见性,如拨波觅月;意净则心清,不了意而求明心,如索镜增尘。
✋热门推荐