.\" -*- coding: UTF-8 -*- '\" t .\" Copyright (c) 1990, 1991 The Regents of the University of California. .\" All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Chris Torek and the American National Standards Committee X3, .\" on Information Processing Systems. .\" .\" SPDX-License-Identifier: BSD-4-Clause-UC .\" .\" @(#)fseek.3 6.11 (Berkeley) 6/29/91 .\" .\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH fseek 3 "20 ​​Julio 2023" "Páginas de manual de Linux 6.05.01" .SH NOMBRE fgetpos, fseek, fsetpos, ftell, rewind \- reposicionarse en un flujo .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSIS .nf \fB#include \fP .PP \fBint fseek(FILE *\fP\fIflujo\fP\fB, long \fP\fIdesplto\fP\fB, int \fP\fIorigen\fP\fB);\fP \fBlong ftell(FILE *\fP\fIflujo\fP\fB);\fP .PP \fBvoid rewind(FILE *\fP\fIflujo\fP\fB);\fP .PP \fBint fgetpos(FILE *restrict \fP\fIflujo\fP\fB, fpos_t *restrict \fP\fIpos\fP\fB);\fP \fBint fsetpos(FILE *\fP\fIflujo\fP\fB, const fpos_t *\fP\fIpos\fP\fB);\fP .fi .SH DESCRIPCIÓN La función \fBfseek\fP() mueve el indicador de posición del fichero correspondiente al flujo de datos apuntado por \fIflujo\fP. La nueva posición, medida en bytes, se obtiene añadiendo \fIdesplto\fP bytes a la posición especificada por \fIorigen\fP. Si \fIorigen\fP es \fBSEEK_SET\fP, \fBSEEK_CUR\fP, o \fBSEEK_END\fP, el desplazamiento es relativo al comienzo del fichero, a la posición actual, o al final del fichero, respectivamente. Una llamada exitosa a la función \fBfseek\fP() limpia el indicador de fin\-de\-fichero para el flujo y deshace cualquier efecto de la función \fBungetc\fP(3) en el mismo flujo. .PP La función \fBftell\fP() obtiene el valor actual del indicador de posición del fichero para el flujo apuntado por \fIflujo\fP. .PP La función \fBrewind\fP() mueve el indicador de posición del fichero para el flujo apuntado por \fIflujo\fP al principio del fichero. Es equivalente a: .PP .RS (void) fseek(stream, 0L, SEEK_SET) .RE .PP salvo en que el indicador de error para el flujo también se limpia (vea \fBclearerr\fP(3)). .PP Las funciones \fBfgetpos\fP() y \fBfsetpos\fP() son interfaces alternativas equivalentes a \fBftell\fP() y \fBfseek\fP() (con el \fIorigen\fP puesto a \fBSEEK_SET\fP), poniendo y almacenando el valor actual del desplazamiento desde o en el objeto referenciado por \fIpos\fP. En algunos sistemas no UNIX un objeto \fIfpos_t\fP puede ser un objeto complejo y estas rutinas pueden ser la única manera de reposicionar un flujo de texto de forma transportable. .PP If the stream refers to a regular file and the resulting stream offset is beyond the size of the file, subsequent writes will extend the file with a hole, up to the offset, before committing any data. See \fBlseek\fP(2) for details on file seeking semantics. .SH "VALOR DEVUELTO" The \fBrewind\fP() function returns no value. Upon successful completion, \fBfgetpos\fP(), \fBfseek\fP(), \fBfsetpos\fP() return 0, and \fBftell\fP() returns the current offset. Otherwise, \-1 is returned and \fIerrno\fP is set to indicate the error. .SH ERRORES .TP \fBEINVAL\fP The \fIwhence\fP argument to \fBfseek\fP() was not \fBSEEK_SET\fP, \fBSEEK_END\fP, or \fBSEEK_CUR\fP. Or: the resulting file offset would be negative. .TP \fBESPIPE\fP The file descriptor underlying \fIstream\fP is not seekable (e.g., it refers to a pipe, FIFO, or socket). .PP Las funciones \fBfgetpos\fP(), \fBfseek\fP(), \fBfsetpos\fP() y \fBftell\fP() pueden fallar también y poner un valor en \fIerrno\fP para cualquiera de los errores especificados para las rutinas \fBfflush\fP(3), \fBfstat\fP(2), \fBlseek\fP(2) y \fBmalloc\fP(3). .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .TS allbox; lbx lb lb l l l. Interfaz Atributo Valor T{ .na .nh \fBfseek\fP(), \fBftell\fP(), \fBrewind\fP(), \fBfgetpos\fP(), \fBfsetpos\fP() T} Seguridad del hilo Multi\-hilo seguro .TE .sp 1 .SH ESTÁNDARES C11, POSIX.1\-2008. .SH HISTORIAL POSIX.1\-2001, C89. .SH "VÉASE TAMBIÉN" \fBlseek\fP(2), \fBfseeko\fP(3) .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Gerardo Aburruzaga García . .PP Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. .PP Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org .ME .