status = fseek(fid,
offset,
'origin')
status = fseek(fid,
offset,
'origin')
repositions the file position indicator in the specified file to the specified byte offset
for the specified origin
. fid
is a integer file identifier obtained from fopen
.
offset
values are interpreted as follows:
-------------------------------------------------------------------offset
>
0
Move position indicatoroffset
bytes toward the end of the file.offset
=
0
Do not change position.offset
<
0
Move position indicatoroffset
bytes toward the be ginning of the file. -------------------------------------------------------------------
origin
can be
-------------------------------------A'bof'
-1
Beginning of file.'cof'
0
Current position in file.'eof'
1
End of file. -------------------------------------
status
value for the operation is returned with value 0 on success and -1 on failure. If an error occurs, use the function ferror
to get more information about the nature of the error.
fclose
,ferror
,fopen
,fprint
,fread
,fscanf
,ftell
,fwrite
,sprintf
,sscanf
(c) Copyright 1994 by The MathWorks, Inc.