1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
|
.\" 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
.\"
.\"*******************************************************************
.\"
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
.TH FSEEK 3 "29. November 1993" GNU Linux\-Programmierhandbuch
.SH BEZEICHNUNG
fgetpos, fseek, fsetpos, ftell, rewind \- Neupositionierung eines Streams
.SH ÜBERSICHT
\fB#include <stdio.h>\fP
.sp
\fBint fseek(FILE *\fP\fIstream\fP\fB, long \fP\fIoffset\fP\fB, int \fP\fIwhence\fP\fB);\fP
\fBlong ftell(FILE *\fP\fIstream\fP\fB);\fP
\fBvoid rewind(FILE *\fP\fIstream\fP\fB);\fP
\fBint fgetpos(FILE *\fP\fIstream\fP\fB, fpos_t *\fP\fIpos\fP\fB);\fP
.br
\fBint fsetpos(FILE *\fP\fIstream\fP\fB, fpos_t *\fP\fIpos\fP\fB);\fP
.SH BESCHREIBUNG
Die Funktion \fBfseek\fP() setzt den Datei\-Positionszeiger für den Stream
\fIstream\fP . Die neue, in Byte gemessene Position ergibt sich durch die
Addition von \fIoffset\fP (Versatz) zu der durch \fIwhence\fP angegebenen
Position. Wenn \fIwhence\fP auf \fBSEEK_SET\fP, \fBSEEK_CUR\fP oder \fBSEEK_END\fP
gesetzt ist, ist der Offset 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 \fIstream\fP zeigt.
.PP
Die Funktion \fBrewind\fP() setzt den Dateipositionszeiger für den Stream, auf
den \fIstream\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 whence auf \fBSEEK_SET\fP
gesetzt). Sie bestimmen den aktuellen Wert des Dateioffsets 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 Offset. Anderenfalls wird \-1 zurückgegeben und \fIerrno\fP
gesetzt, um den Fehler anzuzeigen.
.SH FEHLER
.TP
\fBEBADF\fP
Der angegebene Stream ist nicht durchsuchbar.
.TP
\fBEINVAL\fP
Das Argument \fIwhence\fP für \fBfseek\fP() war nicht \fBSEEK_SET\fP, \fBSEEK_END\fP
oder \fBSEEK_CUR\fP.
.PP
Die Funktionen \fBfgetpos\fP(), \fBfseek\fP(), \fBfsetpos\fP() und \fBftell\fP() können
auch fehlschlagen und \fIerrno\fP setzen für alle Fehler, die für die Routinen
\fBfflush\fP(3), \fBfstat\fP(2), \fBlseek\fP(2) und \fBmalloc\fP(3) festgelegt sind.
.SH "KONFORM ZU"
C89, C99.
.SH "SIEHE AUCH"
\fBlseek\fP(2), \fBfseeko\fP(3)
.SH KOLOPHON
Diese Seite ist Teil der Veröffentlichung 3.25 des Projekts
Linux\-\fIman\-pages\fP. Eine Beschreibung des Projekts und Informationen, wie
Fehler gemeldet werden können, finden sich unter
http://www.kernel.org/doc/man\-pages/.
.SH ÜBERSETZUNG
Die deutsche Übersetzung dieser Handbuchseite wurde von
Patrick Rother <krd@gulu.net>
und
Martin E. Schauer <Martin.E.Schauer@gmx.de>
erstellt.
Diese Übersetzung ist Freie Dokumentation; lesen Sie die
GNU General Public License Version 3 oder neuer bezüglich der
Copyright-Bedingungen. Es wird KEINE HAFTUNG übernommen.
Wenn Sie Fehler in der Übersetzung dieser Handbuchseite finden,
schicken Sie bitte eine E-Mail an <debian-l10n-german@lists.debian.org>.
|