fseek函数
说明:本文主要是对man 帮助命令的翻译,若有错误,欢迎指正。
在linux学习过程中,如果我们遇到一个陌生函数,都会想赶快查一下,你通常是怎么查询linux系统函数和命令的使用方法呢?google?百度?还是使用man命令?其实对于一个初级程序员,学习使用man命令是很有益的,我们可能看到很多网上的说明都是对man帮助文档的翻译。所以,如果你英文不是很差,就自己来翻译一下你想要查询的信息吧!
今天我们就通过这样的方式学习一下fseek这个函数。
打开linux的控制台,我们输入“man fseek”:会进入帮助文档,里面关于fseek的说明是这样的:
FSEEK(3) Linux Programmer's Manual FSEEK(3)
NAME
fgetpos, fseek, fsetpos, ftell, rewind - reposition a stream
SYNOPSIS
#include <stdio.h>
int fseek(FILE *stream, long offset, int whence);
long ftell(FILE *stream);
void rewind(FILE *stream);
int fgetpos(FILE *stream, fpos_t *pos);
int fsetpos(FILE *stream, fpos_t *pos);
DESCRIPTION
The fseek() function sets the file position indicator for the stream pointed to by stream. The new
position, measured in bytes, is obtained by adding offset bytes to the position specified by whence. If
whence is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start of the file, the
current position indicator, or end-of-file<