.\" -*- 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 avril 2018" GNU "Manuel du programmeur Linux" .SH NOM fgetpos, fseek, fsetpos, ftell, rewind \- Positionner un flux .SH SYNOPSIS \fB#include \fP .PP \fBint fseek(FILE *\fP\fIstream\fP\fB, long \fP\fIoffset\fP\fB, int \fP\fIwhence\fP\fB);\fP .PP \fBlong ftell(FILE *\fP\fIstream\fP\fB);\fP .PP \fBvoid rewind(FILE *\fP\fIstream\fP\fB);\fP .PP \fBint fgetpos(FILE *\fP\fIstream\fP\fB, fpos_t *\fP\fIpos\fP\fB);\fP .PP \fBint fsetpos(FILE *\fP\fIstream\fP\fB, const fpos_t *\fP\fIpos\fP\fB);\fP .SH DESCRIPTION La fonction \fBfseek\fP() définit l'indicateur de position du flux pointé par \fIstream\fP. La nouvelle position, mesurée en octets, est obtenue en additionnant \fIoffset\fP octets au point de départ indiqué par \fIwhence\fP. Si \fIwhence\fP vaut \fBSEEK_SET\fP, \fBSEEK_CUR\fP, ou \fBSEEK_END\fP, le point de départ correspond respectivement au début du fichier, à la position actuelle, ou à la fin du fichier. Un appel réussi à \fBfseek\fP() efface l'indicateur de fin de fichier du flux, et annule les effets de toute fonction \fBungetc\fP(3) sur le même flux. .PP La fonction \fBftell\fP() obtient la valeur de l'indicateur de position du flux pointé par \fIstream\fP. .PP La fonction \fBrewind\fP() place l'indicateur de position du flux pointé par \fIstream\fP au début du fichier. C'est l'équivalent de\ : .PP .RS (void) fseek(stream, 0L, SEEK_SET) .RE .PP sauf que l'indicateur d'erreur du flux est également effacé (consultez \fBclearerr\fP(3)). .PP Les fonctions \fBfgetpos\fP() et \fBfsetpos\fP() sont des alternatives à \fBftell\fP() et \fBfseek\fP() (avec \fIwhence\fP à \fBSEEK_SET\fP), en définissant et en mémorisant la valeur de l'indicateur de position du fichier dans ou depuis l'objet référencé par \fIpos\fP. Sur certains systèmes non UNIX, l'objet \fIfpos_t\fP peut être un objet complexe, et ces routines peuvent être les seules méthodes possibles pour repositionner un flux de texte de manière portable. .SH "VALEUR RENVOYÉE" La fonction \fBrewind\fP() ne renvoie pas de valeur. Si elles réussissent totalement, \fBfgetpos\fP(), \fBfseek\fP(), \fBfsetpos\fP() renvoient 0, et \fBftell\fP() renvoie la position actuelle. Sinon, elles renvoient \-1 et la variable globale \fIerrno\fP contient le code d'erreur. .SH ERREURS .TP \fBEINVAL\fP L'argument \fIwhence\fP de \fBfseek\fP() n'était ni \fBSEEK_SET\fP, ni \fBSEEK_END\fP, ni \fBSEEK_CUR\fP. Autrement, le décalage du fichier aurait été négatif. .TP \fBESPIPE\fP The file descriptor underlying \fIstream\fP is not seekable (e.g., it refers to a pipe, FIFO, or socket). .PP Les fonctions \fBfgetpos\fP(), \fBfseek\fP(), \fBfsetpos\fP(), et \fBftell\fP() peuvent également, en cas d'échec, définir \fIerrno\fP sur n'importe quelle erreur indiquée par les routines \fBfflush\fP(3), \fBfstat\fP(2), \fBlseek\fP(2) et \fBmalloc\fP(3). .SH ATTRIBUTS Pour une explication des termes utilisés dans cette section, consulter \fBattributes\fP(7). .TS allbox; lbw27 lb lb l l l. Interface Attribut Valeur T{ \fBfseek\fP(), \fBftell\fP(), \fBrewind\fP(), .br \fBfgetpos\fP(), \fBfsetpos\fP() T} Sécurité des threads MT\-Safe .TE .sp 1 .SH CONFORMITÉ POSIX.1\-2001, POSIX.1\-2008, C89, C99. .SH "VOIR AUSSI" \fBlseek\fP(2), \fBfseeko\fP(3) .SH COLOPHON Cette page fait partie de la publication\ 5.10 du projet \fIman\-pages\fP Linux. Une description du projet et des instructions pour signaler des anomalies et la dernière version de cette page peuvent être trouvées à l'adresse \%https://www.kernel.org/doc/man\-pages/. .SH TRADUCTION La traduction française de cette page de manuel a été créée par Christophe Blaess , Stéphan Rafin , Thierry Vignaud , François Micaux, Alain Portal , Jean-Philippe Guérard , Jean-Luc Coulon (f5ibh) , Julien Cristau , Thomas Huriaux , Nicolas François , Florentin Duneau , Simon Paillard , Denis Barbier , David Prévot et Frédéric Hantrais . Cette traduction est une documentation libre ; veuillez vous reporter à la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License version 3 .UE concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE. Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à .MT debian-l10n-french@lists.debian.org .ME .