linux open lseek
来源:互联网 发布:广联达软件介绍 编辑:程序博客网 时间:2024/05/16 05:28
#include <sys/types.h>#include <unistd.h>#include <sys/stat.h>#include <fcntl.h>#include <stdio.h>int main(){struct timeval{unsigned int tv_sec;unsigned int tv_usec;};struct timeval time_a;int fd = open("timefile", O_RDONLY);lseek( fd, 4, SEEK_SET );read( fd, &(time_a.tv_usec),4 ); close( fd );printf("time = %d.%d\n", time_a.tv_sec, time_a.tv_usec );return 0;}
NAME
lseek - reposition read/write file offset
SYNOPSIS
#include <sys/types.h> #include <unistd.h> off_t lseek(int fd, off_t offset, int whence);
DESCRIPTION The lseek() function repositions the offset of the open file associated with the file descriptor fd to the argument offset according to the directive whence as follows:
SEEK_SET
The offset is set to offset bytes.
SEEK_CUR
The offset is set to its current location plus offset bytes.
SEEK_END
The offset is set to the size of the file plus offset bytes.
man 2 lseek
0 0
- linux open lseek
- linux open read write lseek close
- Linux基础编程-文件操作open,lseek,read,write,close
- Linux基础编程-文件操作open,lseek,read,write,close
- linux下的open()read()write()close()lseek()函数
- linux文件I/O编程 (open、read、write、lseek、close)
- Linux 文件IO函数(open/close/read/write/lseek)
- Linux 文件描述符(open,read,write,lseek,close)
- Linux 文件IO — open、read、write 、lseek
- Linux基础编程-文件操作open,lseek,read,write,close
- linux文件操作open close read write lseek
- Linux 文件操作 open,lseek,read,write,close
- Linux&C open creat read write lseek 函数用法总结
- Linux 文件系统调用函数open close read write lseek perror
- Linux文件IO-open,write,read,lseek,close
- open+errno+write+lseek
- linux lseek
- 嵌入式linux文件I/O编程 (open、read、write、lseek、close)
- ES postfilter的危害(持续更新)
- Python练习实例2
- 使用RecyclerView实现瀑布流布局(一)
- WINDOW进程通信的几种方式
- QScintilla编译安装使用
- linux open lseek
- 自定义UITableViewCell分割线不显示或粗细不同的原因
- Android Instant App 介绍
- mysqldmp 参数之--skip-opt 与--opt
- 自定义RPC通讯框架,实现dubbo远程RPC服务治理功能
- 17 - 02 - 08 计算机网络(29)(Cookie)
- 【caffe源码研究】第四章:完整案例源码篇(1) :LeNetSolver初始化
- 去除掉浏览器对输入框的自动补全
- OpenMP入门程序