.\" -*- 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. April 2018" GNU Linux\-Programmierhandbuch .SH BEZEICHNUNG fgetpos, fseek, fsetpos, ftell, rewind \- Neupositionierung eines Streams .SH ÜBERSICHT \fB#include \fP .PP \fBint fseek(FILE *\fP\fIdatenstrom\fP\fB, long \fP\fIVersatz\fP\fB, int \fP\fIwoher\fP\fB);\fP .PP \fBlong ftell(FILE *\fP\fIdatenstrom\fP\fB);\fP .PP \fBvoid rewind(FILE *\fP\fIdatenstrom\fP\fB);\fP .PP \fBint fgetpos(FILE *\fP\fIdatenstrom\fP\fB, fpos_t *\fP\fIpos\fP\fB);\fP .PP \fBint fsetpos(FILE *\fP\fIdatenstrom\fP\fB, const fpos_t *\fP\fIpos\fP\fB);\fP .SH BESCHREIBUNG Die Funktion \fBfseek\fP() setzt den Datei\-Positionszeiger für den Stream \fIdatenstrom\fP. Die neue, in Byte gemessene Position ergibt sich durch die Addition von \fIVersatz\fP zu der durch \fIwoher\fP angegebenen Position. Wenn \fIwoher\fP auf \fBSEEK_SET\fP, \fBSEEK_CUR\fP oder \fBSEEK_END\fP gesetzt ist, ist der Versatz relativ zum Dateianfang, der aktuellen Position oder dem Dateiende. Ein erfolgreicher Aufruf von \fBfseek\fP() löscht den Dateiendezeiger für den Stream und macht alle Auswirkungen der Funktion \fBungetc\fP(3) für den Stream rückgängig. .PP Die Funktion \fBftell\fP() beschafft den aktuellen Wert des Dateipositionszeigers für den Stream, auf den \fIdatenstrom\fP zeigt. .PP Die Funktion \fBrewind\fP() setzt den Dateipositionszeiger für den Stream, auf den \fIdatenstrom\fP zeigt, auf den Dateianfang. Sie ist äquivalent zu .PP .RS (void) fseek(stream, 0L, SEEK_SET) .RE .PP löscht aber zusätzlich den Fehlerindikator für den Stream (siehe \fBclearerr\fP(3)). .PP Die Funktionen \fBfgetpos\fP() und \fBfsetpos\fP() sind alternative Schnittstellen und gleichwertig zu \fBftell\fP() und \fBfseek\fP() (mit \fIwoher\fP auf \fBSEEK_SET\fP gesetzt). Sie bestimmen den aktuellen Wert des Dateiversatzes und speichern ihn in oder von dem durch \fIpos\fP referenzierten Objekt. Auf einigen Nicht\-UNIX\-Systemen kann ein Objekt \fBfpos_t\fP ein komplexes Objekt sein. Diese Routinen können der einzige Weg sein, einen Text\-Stream portabel neu zu positionieren. .SH RÜCKGABEWERT Die Funktion \fBrewind\fP() gibt keinen Wert zurück. Bei erfolgreichem Abschluss geben \fBfgetpos\fP(), \fBfseek\fP(), \fBfsetpos\fP() 0 zurück; \fBftell\fP() den aktuellen Versatz. Anderenfalls wird \-1 zurückgegeben und \fIerrno\fP gesetzt, um den Fehler anzuzeigen. .SH FEHLER .TP \fBEINVAL\fP Das Argument \fIwoher\fP für \fBfseek\fP() war nicht \fBSEEK_SET\fP, \fBSEEK_END\fP oder \fBSEEK_CUR\fP. Oder: der entstehende Datei\-Versatz wäre negativ. .TP \fBESPIPE\fP Der \fIdatenstrom\fP unterliegende Dateideskriptor ist nicht durchsuchbar (er bezieht sich z.B. auf eine Pipe, ein FIFO oder Socket). .PP Die Funktionen \fBfgetpos\fP(), \fBfseek\fP(), \fBfsetpos\fP() und \fBftell\fP() können auch fehlschlagen und \fIerrno\fP für alle Fehler setzen, die für die Routinen \fBfflush\fP(3), \fBfstat\fP(2), \fBlseek\fP(2) und \fBmalloc\fP(3) festgelegt sind. .SH ATTRIBUTE Siehe \fBattributes\fP(7) für eine Erläuterung der in diesem Abschnitt verwandten Ausdrücke. .TS allbox; lbw27 lb lb l l l. Schnittstelle Attribut Wert T{ \fBfseek\fP(), \fBftell\fP(), \fBrewind\fP(), .br \fBfgetpos\fP(), \fBfsetpos\fP() T} Multithread\-Fähigkeit MT\-Safe .TE .sp 1 .SH "KONFORM ZU" POSIX.1\-2001, POSIX.1\-2008, C89, C99. .SH "SIEHE AUCH" \fBlseek\fP(2), \fBfseeko\fP(3) .SH KOLOPHON Diese Seite ist Teil der Veröffentlichung 5.10 des Projekts Linux\-\fIman\-pages\fP. Eine Beschreibung des Projekts, Informationen, wie Fehler gemeldet werden können, sowie die aktuelle Version dieser Seite finden sich unter \%https://www.kernel.org/doc/man\-pages/. .PP .SH ÜBERSETZUNG Die deutsche Übersetzung dieser Handbuchseite wurde von Patrick Rother , Martin Eberhard Schauer , Mario Blättermann und Helge Kreutzmann erstellt. .PP Diese Übersetzung ist Freie Dokumentation; lesen Sie die .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE oder neuer bezüglich der Copyright-Bedingungen. Es wird KEINE HAFTUNG übernommen. .PP Wenn Sie Fehler in der Übersetzung dieser Handbuchseite finden, schicken Sie bitte eine E-Mail an die .MT debian-l10n-german@lists.debian.org Mailingliste der Übersetzer .ME .