.\" -*- coding: UTF-8 -*- .\" 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. .\" .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB) .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" %%%LICENSE_END .\" .\" @(#)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 "30 Abril 2018" GNU "Manual del Programador de Linux" .SH NOMBRE fgetpos, fseek, fsetpos, ftell, rewind \- reposicionarse en un flujo .SH SINOPSIS \fB#include \fP .PP \fBint fseek(FILE *\fP\fIflujo\fP\fB, long \fP\fIdesplto\fP\fB, int \fP\fIorigen\fP\fB);\fP .PP \fBlong ftell(FILE *\fP\fIflujo\fP\fB);\fP .PP \fBvoid rewind(FILE *\fP\fIflujo\fP\fB);\fP .PP \fBint fgetpos(FILE *\fP\fIflujo\fP\fB, fpos_t *\fP\fIpos\fP\fB);\fP .PP \fBint fsetpos(FILE *\fP\fIflujo\fP\fB, const fpos_t *\fP\fIpos\fP\fB);\fP .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. .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; lbw27 lb lb l l l. Interfaz Atributo Valor T{ \fBfseek\fP(), \fBftell\fP(), \fBrewind\fP(), .br \fBfgetpos\fP(), \fBfsetpos\fP() T} Seguridad del hilo Multi\-hilo seguro .TE .sp 1 .SH "CONFORME A" POSIX.1\-2001, POSIX.1\-2008, C89, C99. .SH "VÉASE TAMBIÉN" \fBlseek\fP(2), \fBfseeko\fP(3) .SH COLOFÓN Esta página es parte de la versión 5.10 del proyecto Linux \fIman\-pages\fP. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en \%https://www.kernel.org/doc/man\-pages/. .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Gerardo Aburruzaga García . 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. 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 .