.\" 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. .\" .\" 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. .\" .\" @(#)fseek.3 6.11 (Berkeley) 6/29/91 .\" .\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu .\" Translated to German Tue Dec 31 1996 by Patrick Rother .\" .TH FSEEK 3 "31. Dezember 1996" "BSD MANPAGE" "Bibliotheksfunktionen" .SH BEZEICHNUNG fgetpos, fseek, fsetpos, ftell, rewind \- positioniere einen Stream neu .SH ÜBERSICHT .B #include .sp .BI "int fseek( FILE *" stream ", long " offset ", int " whence ); .br .BI "long ftell( FILE *" stream ); .br .BI "void rewind( FILE *" stream ); .br .BI "int fgetpos( FILE *" stream ", fpos_t *" pos ); .br .BI "int fsetpos( FILE *" stream ", fpos_t *" pos ); .SH BESCHREIBUNG Die Funktion .B fseek setzt den Dateipositionszeiger für den Stream, auf den .IR stream zeigt. Die neue Position, gemessen in Byte, wird erreicht durch addieren von .I offset zu der Position, die durch .IR whence angegeben ist. Wenn .I whence auf .BR SEEK_SET , .BR SEEK_CUR , oder .BR SEEK_END , gesetzt ist, ist der Offset relativ zum Dateianfang, der aktuellen Position, oder dem Dateiende. Ein erfolgreicher Aufruf der Funktion .B fseek löscht den Dateiendezeiger für den Stream und macht den Effekt der Funktion .BR ungetc (3) Rückgängig für den Stream. .PP Die Funktion .B ftell holt der aktuellen Wert des Dateipositionszeigers für den Stream, auf den .IR stream zeigt. .PP Die Funktion .B rewind setzt den Dateipositionszeigers für den Stream, auf den .I stream zeigt, auf den Dateianfang. Sie ist äquivalent zu: .PP .RS (void)fseek(stream, 0L, SEEK_SET) .RE .PP außer dass der Fehlerindikator für den Stream auch gelöscht wird (siehe .BR clearerr (3). .PP Die Funktionen .B fgetpos und .B fsetpos sind alternative Schnittstellen zu .B ftell und .B fseek (mit whence gesetzt auf .BR SEEK_SET ), die den aktuellen Wert des Dateioffsets lesen oder setzen von dem oder auf das Objekt angegeben durch .IR pos . Auf einigen Nicht-UNIX-Systemen kann ein Objekt .B fpos_t ein komplexes Objekt sein, und diese Routinen können der einzige Weg sein, den Dateizeiger portabel zu beeinflussen. .SH RÜCKGABEWERTE Die Funktion .B rewind gibt keinen Wert zurück. Bei erfolgreichem Abschluss geben .BR fgetpos , .BR fseek , .B fsetpos 0 zurück, während .B ftell den aktuellen Offset zurückgibt. Anderenfalls wird \-1 zurückgegeben und die globale Variable errno gesetzt um den Fehler anzuzeigen. .SH FEHLER .TP .B EBADF Der angegebene .I stream ist nicht positionierbar. .TP .B EINVAL Das Argument .I whence für .B fseek war nicht .BR SEEK_SET , .BR SEEK_END , oder .BR SEEK_CUR . .PP Die Funktion .BR fgetpos , .BR fseek , .BR fsetpos , und .B ftell können auch fehlschlagen und .I errno setzen für Fehler, die für die Routinen .BR fflush (3), .BR fstat (2), .BR lseek (2), und .BR malloc (3) spezifiziert sind. .SH "SIEHE AUCH" .BR lseek (2). .SH "KONFORM ZU" Die Funktionen .BR fgetpos , .BR fsetpos , .BR fseek , .BR ftell , und .BR rewind sind konform zu ANSI C3.159-1989 (``ANSI C'').