description | title | ms.date | api_name | api_location | api_type | topic_type | f1_keywords | helpviewer_keywords | ms.assetid | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: fsetpos |
fsetpos |
4/2/2020 |
|
|
|
|
|
|
6d19ff48-1a2b-47b3-9f23-ed0a47b5a46e |
Sets the stream-position indicator.
int fsetpos(
FILE *stream,
const fpos_t *pos
);
stream
Pointer to FILE
structure.
pos
Position-indicator storage.
If successful, fsetpos
returns 0. On failure, the function returns a nonzero value and sets errno
to one of the following manifest constants (defined in ERRNO.H): EBADF
, which means the file isn't accessible or the object that stream
points to isn't a valid file structure; or EINVAL
, which means an invalid value for stream
or pos
was passed. If an invalid parameter is passed in, these functions invoke the invalid parameter handler, as described in Parameter validation.
For more information about return codes, see errno
, _doserrno
, _sys_errlist
, and _sys_nerr
.
The fsetpos
function sets the file-position indicator for stream
to the value of pos
, which is obtained in a prior call to fgetpos
against stream
. The function clears the end-of-file indicator and undoes any effects of ungetc
on stream
. After a call to fsetpos
, the next operation on stream
may be either input or output.
By default, this function's global state is scoped to the application. To change this behavior, see Global state in the CRT.
Function | Required header |
---|---|
fsetpos |
<stdio.h> |
For more compatibility information, see Compatibility.
See the example for fgetpos
.