Chapter Contents |
Previous |
Next |
fgetpos |
Portability: | ISO/ANSI C conforming |
SYNOPSIS | |
DESCRIPTION | |
RETURN VALUE | |
IMPLEMENTATION | |
EXAMPLE | |
RELATED FUNCTIONS | |
SEE ALSO |
SYNOPSIS |
#include <stdio.h> int fgetpos(FILE *f, fpos_t *pos);
DESCRIPTION |
fgetpos
determines the current file position for the stream associated with the
FILE
object addressed by
f
, and it stores the file position in the object pointed to by
pos
. This object is of type
fpos_t
, which is defined
in
stdio.h
.
The stored value can be passed to the
fsetpos
function to reposition the file to its position at the time of the
call to
fgetpos
.
You can use
fgetpos
with most types of files, using either text or binary access. Note that you
can use it to obtain the current position for many files that
ftell
cannot process, including files accessed as a binary stream using
the
"seq"
access method. See OS/390 Files with Restricted Positioning and CMS Files with Restricted Positioning for file types that are
not fully supported by
fgetpos
.
RETURN VALUE |
If successful,
fgetpos
returns 0. If it fails,
fgetpos
returns a nonzero value and stores an appropriate error code in
errno
. See
The errno Variable for the list of
errno
values.
A program that uses the components of an
fpos_t
value is not portable.
IMPLEMENTATION |
See File positioning with fgetpos and fsetpos for information on the implementation
of
fgetpos
and the structure of
fpos_t
values.
EXAMPLE |
RELATED FUNCTIONS |
fsetpos
,
ftell
,
kgetpos
,
lseek
SEE ALSO |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.