从文件中读取描述符/写偏移 [英] Read/write from file descriptor at offset

查看:104
本文介绍了从文件中读取描述符/写偏移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直使用write(2),阅读(2) HTTP描述的功能: //linux.die.net/man/2/read 的http:// linux的.die.net /人/ 2 /写来读取和写入给出的文件描述符的文件。有没有这样的功能,可以让你把一个偏移读文件/写?我是新的C,所以希望这不是一个愚蠢的问题。

I've been using the write(2) and read(2) functions described on http://linux.die.net/man/2/read and http://linux.die.net/man/2/write to read and write to a file given a file descriptor. Is there any function like this that allows you to put an offset into the file for read/write? I'm new to c so hopefully this isn't a stupid question.

推荐答案

是的,你要找的 lseek的

http://linux.die.net/man/2/lseek

这篇关于从文件中读取描述符/写偏移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆