̾??
fgetpos
, fseek
,
fseeko
, fsetpos
,
ftell
, ftello
,
rewind
—
???ȥ???ΰ????ѹ?
Standard C Library (libc, -lc)
<stdio.h>
int
fseek
(FILE
*stream, long offset, int
whence) long
ftell
(FILE *stream)
void
rewind
(FILE *stream)
int
fgetpos
(FILE *stream,
fpos_t *pos) int
fsetpos
(FILE *stream,
const fpos_t *pos)
<sys/types.h>
int
fseeko
(FILE *stream,
off_t offset, int whence)
off_t
ftello
(FILE *stream)
fseek
() ?ؿ??ϡ?
stream
???ؤ????ȥ???Υե????????֥?????????
???ꤷ?ޤ????????????֤ϥХ???ñ?̤Ƿ?¬???졢
whence ?ǻ??ꤵ?줿???֤?
offset
?Х??Ȥ??????Ȥ????????ޤ???
whence ?? SEEK_SET
,
SEEK_CUR
, SEEK_END
?????ꤵ???Ƥ??????硢???ե??åȤϡ????줾?졢?ե??????κǽ顢
?????????θ??߰??֡??ե??????κǸ夫???????а??֤ˤʤ??ޤ???
fseek
()
?ؿ??θƤӽФ???
???꤬ȯ?????ʤ??????ϡ????ȥ????
end-of-file ?ؼ??Ҥ????ꥢ???졢
???Υ??ȥ?????Ф???
ungetc(3)
?ؿ??θ??̤ϼ????ä????ޤ???
ftell
()
?ؿ??ϡ? stream
???ؤ????ȥ???Υե????????֥?????????
???ߤ??ͤ????ꤷ?ޤ???
rewind
()
?ؿ??ϡ? stream
???ؤ????ȥ???Υե????????֥?????????
?ե??????κǽ??????ꤷ?ޤ????????ϡ?
???ȥ???Υ??顼?????????????ꥢ?????뤳??
(
clearerr(3)
??)
???????С??ʲ???Ʊ?????̤ˤʤ??ޤ???
(void)fseek(stream, 0L,
SEEK_SET)
fseeko
()
?ؿ??? fseek
()
??Ʊ?ͤǤ????? ?????ˤ? long
?????????? off_t ???Ȥ??ޤ???
Ʊ?ͤ? ftello
() ?ؿ???
ftell
() ??Ʊ???Ǥ?????
off_t ???֤??ޤ???
fgetpos
()
?ؿ???
fsetpos
()
?ؿ??ϡ?( whence ?? SEEK_SET
?????ꤷ?? ) ftell
() ??
fseek
()
??Ʊ?????ե??????ǡ??ե????륪?ե??åȤθ??ߤ??ͤ?
pos
?????Ȥ??륪?֥??????Ȥ??????ꤷ???ꡢ
pos
?????Ȥ??륪?֥??????Ȥ???¸?????ꤷ?ޤ???
?????? (UNIX ?ʳ???) ?????ƥ??Ǥϡ?
“fpos_t”
???֥??????Ȥ?ʣ?祪?֥??????ȤǤ??뤫?⤷???ʤ??Τǡ?
?ܿ??????ݤ??ʤ????ƥ????ȥ??ȥ???ΰ??֤?
?ѹ????뤿???ˤϡ????Υ롼?????˰ͤ뤷???ʤ????Ȥ⤢???ޤ???
rewind
()
?ؿ????ͤ??֤??ޤ?????
The fgetpos
(), fseek
(),
fseeko
(), and fsetpos
()
functions return the value 0 if successful; otherwise the
value -1 is returned and the global variable
errno is set to indicate the error.
???????ƽ?λ?????ȡ?
ftell
()
??????
ftello
()
?ϸ??ߤΥ??ե??åȤ??֤??ޤ????????ʳ??ξ?????
-1 ???֤??졢 ???????Х??ѿ?
errno
?????ꤵ???ƥ??顼???ޤ???
- [
EBADF
]
- ???ꤵ?줿 stream
???????????Ǥ??륹?ȥ???ǤϤ????ޤ?????
- [
EINVAL
]
fseek
() ?? whence ????????
SEEK_SET
, SEEK_END
,
SEEK_CUR
?Τɤ??Ǥ⤢???ޤ?????
- [
EOVERFLOW
]
ftell
()
???¹Ԥ??????̤Υե??????Υ??ե??åȤ?
long
???Υ??֥??????ȤǤ???????ɽ???Ǥ??ʤ??ͤȤʤ??ޤ?????
fgetpos
(),
fseek
(), fseeko
(),
fsetpos
(), ftell
(),
ftello
()
?ؿ??????Ԥ??????ˤϡ? ?롼????
fflush(3),
fstat(2),
lseek(2),
malloc(3)
?ˤĤ??Ƽ????Ƥ??륨?顼??
errno
?????ꤵ???Ƥ??뤳?Ȥ⤢???ޤ???
fgetpos
(),
fsetpos
(), fseek
(),
ftell
(), rewind
()
?ؿ??ϡ? ISO/IEC 9899:1990
(“ISO C90”)
??Ŭ?礷?Ƥ??ޤ???
fseeko
()
??
ftello
()
?ؿ??ϡ? Version 2 of the Single UNIX
Specification (“SUSv2”)
??Ŭ?礷?Ƥ??ޤ???