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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
|
.\" 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 <krd@gulu.net>
.\"
.TH FSEEK 3 "31. Dezember 1996" "BSD MANPAGE" "Bibliotheksfunktionen"
.SH BEZEICHNUNG
fgetpos, fseek, fsetpos, ftell, rewind \- positioniere einen Stream neu
.SH BERSICHT
.B #include <stdio.h>
.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 fr 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
lscht den Dateiendezeiger fr den Stream und macht den Effekt der Funktion
.BR ungetc (3)
Rckgngig fr den Stream.
.PP
Die Funktion
.B ftell
holt der aktuellen Wert des Dateipositionszeigers fr den Stream, auf den
.IR stream
zeigt.
.PP
Die Funktion
.B rewind
setzt den Dateipositionszeigers fr den Stream, auf den
.I stream
zeigt, auf den Dateianfang. Sie ist quivalent zu:
.PP
.RS
(void)fseek(stream, 0L, SEEK_SET)
.RE
.PP
auer da der Fehlerindikator fr den Stream auch gelscht 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 knnen der einzige Weg sein,
den Dateizeiger portabel zu beeinflussen.
.SH RCKGABEWERTE
Die Funktion
.B rewind
gibt keinen Wert zurck. Bei erfolgreichem Abschluss geben
.BR fgetpos ,
.BR fseek ,
.B fsetpos
0 zurck, whrend
.B ftell
den aktuellen Offset zurckgibt. Anderenfalls wird \-1 zurckgegeben 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
fr
.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
knnen auch fehlschlagen und
.I errno
setzen fr Fehler, die fr 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'').
|