مشاركة عبر


fsetpos

Sets the stream-position indicator.

int fsetpos( 
   FILE *stream,
   const fpos_t *pos 
);

Parámetros

  • stream
    Pointer to FILE structure.

  • pos
    Position-indicator storage.

Valor devuelto

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 is not accessible or the object that stream points to is not 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.

See _doserrno, errno, _sys_errlist, and _sys_nerr for more information on these, and other, return codes.

Comentarios

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 calling fsetpos, the next operation on stream may be either input or output.

Requisitos

Function

Required header

fsetpos

<stdio.h>

For additional compatibility information, see Compatibility in the Introduction.

Ejemplo

See the example for fgetpos.

Equivalente en .NET Framework

System::IO::FileStream::Position

Vea también

Referencia

Stream I/O

fgetpos