1 .\" Copyright (c) 1990, 1991 The Regents of the University of California.
2 .\" All rights reserved.
4 .\" This code is derived from software contributed to Berkeley by
5 .\" Chris Torek and the American National Standards Committee X3,
6 .\" on Information Processing Systems.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. All advertising materials mentioning features or use of this software
17 .\" must display the following acknowledgement:
18 .\" This product includes software developed by the University of
19 .\" California, Berkeley and its contributors.
20 .\" 4. Neither the name of the University nor the names of its contributors
21 .\" may be used to endorse or promote products derived from this software
22 .\" without specific prior written permission.
24 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 .\" @(#)fseek.3 6.11 (Berkeley) 6/29/91
38 .\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu
41 .\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
42 .\" Translated Mon Apr 27 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
44 .\" WORD: file position indicator ¥Õ¥¡¥¤¥ë°ÌÃÖɽ¼¨»Ò
45 .\" WORD: error indicator ¥¨¥é¡¼É½¼¨»Ò
47 .TH FSEEK 3 1993-11-29 "GNU" "Linux Programmer's Manual"
49 fgetpos, fseek, fsetpos, ftell, rewind \- ¥¹¥È¥ê¡¼¥à¤Î°ÌÃÖ¤òÊѹ¹¤¹¤ë
53 .BI "int fseek(FILE *" stream ", long " offset ", int " whence );
55 .BI "long ftell(FILE *" stream );
57 .BI "void rewind(FILE *" stream );
59 .BI "int fgetpos(FILE *" stream ", fpos_t *" pos );
61 .BI "int fsetpos(FILE *" stream ", fpos_t *" pos );
66 ¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤Ë¤ª¤¤¤Æ¡¢¥Õ¥¡¥¤¥ë°ÌÃÖɽ¼¨»Ò
67 (file position indicator) ¤ò¥»¥Ã¥È¤¹¤ë¡£¿·¤¿¤Ê°ÌÃÖ (¥Ð¥¤¥Èñ°Ì)
72 ¥Ð¥¤¥È¤ò²Ã¤¨¤ë¤³¤È¤Ë¤è¤Ã¤ÆÍ¿¤¨¤é¤ì¤ë¡£
78 ¤Î¤É¤ì¤«¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤½¤ì¤¾¤ì¥Õ¥¡¥¤¥ë¤ÎÀèƬ¡¢¸½ºß¤Î°ÌÃÖɽ¼¨»Ò¡¢
79 ¥Õ¥¡¥¤¥ë¤ÎËöÈø¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¤¬¼è¤é¤ì¤ë¡£
81 ´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¤È¡¢¥¹¥È¥ê¡¼¥à¤Î end-of-file ɽ¼¨»Ò¤Ï
82 ¥¯¥ê¥¢¤µ¤ì¡¢¤½¤ì¤Þ¤Ç¤Ë
84 ´Ø¿ô¤ÇÌᤷ¤¿¥Ç¡¼¥¿¤Ï¤Ê¤«¤Ã¤¿¤³¤È¤Ë¤Ê¤ë¡£
89 ¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤Ë¤ª¤±¤ë¡¢¥Õ¥¡¥¤¥ë°ÌÃÖɽ¼¨»Ò
90 ¤Î¸½»þÅÀ¤Ç¤ÎÃͤòÍ¿¤¨¤ë¡£
95 ¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¥¹¥È¥ê¡¼¥à¤Ë¤ª¤¤¤Æ¡¢¥Õ¥¡¥¤¥ë°ÌÃÖɽ¼¨»Ò
96 ¤ò¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤Ë¥»¥Ã¥È¤¹¤ë¡£¤³¤Î´Ø¿ô¤Ï°Ê²¼¤ÈÅù²Á¤Ç¤¢¤ë¡£
99 (void) fseek(stream, 0L, SEEK_SET)
104 ¤Ç¤Ï¥¹¥È¥ê¡¼¥à¤ËÂФ¹¤ë¥¨¥é¡¼É½¼¨»Ò (error indicator) ¤âƱ»þ¤Ë
120 ¤ò»ØÄꤷ¤¿¾ì¹ç¤ÈƱÍͤε¡Ç½¤ò¡¢°Û¤Ê¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÇÄ󶡤¹¤ë¡£
122 ¤Ï¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤Î¸½ºß¤ÎÃͤò
124 ¤¬»²¾È¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤ËÊݸ¤·¡¢
126 ¤Ï¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤ò
129 Unix °Ê³°¤Î¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ¤Ï¡¢
131 ¤¬¹½Â¤ÂΤʤɤÎÊ£»¨¤Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤Ê¤Ã¤Æ¤¤¤Æ¡¢¤³¤ì¤é¤Î¥ë¡¼¥Á¥ó¤¬¥Æ¥¥¹
132 ¥È¥¹¥È¥ê¡¼¥à¤Ç¥Õ¥¡¥¤¥ë°ÌÃÖ¤òÊѹ¹¤¹¤ëÊýË¡¤Î¤¦¤Á¡¢°Ü¿¢À¤Î¤¢¤ëÍ£°ì¤Î¤â¤Î
133 ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤â¤¢¤ë¡£
140 ¤ÏÀ®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£
142 ¤Ï¸½ºß¤Î¥ª¥Õ¥»¥Ã¥È¤òÊÖ¤¹¡£¼ºÇÔ¤·¤¿¾ì¹ç¤ÏÊÖ¤êÃÍ¤Ï \-1 ¤È¤Ê¤ê¡¢
144 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£
171 ¤Ê¤É¤Î¥ë¡¼¥Á¥ó¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë¼ºÇÔ¤¹¤ë²ÄǽÀ¤¬¤¢¤ë¡£¤³¤Î¾ì¹ç¤Ï