I'm very pleased to announce the release of our new website and documentation using the new toolchain with Hugo and AsciiDoctor. To get more information about the new toolchain please read the FreeBSD Documentation Project Primer[1], Hugo docs[2] and AsciiDoctor docs[3]. Acknowledgment: Benedict Reuschling <bcr@> Glen Barber <gjb@> Hiroki Sato <hrs@> Li-Wen Hsu <lwhsu@> Sean Chittenden <seanc@> The FreeBSD Foundation [1] https://docs.FreeBSD.org/en/books/fdp-primer/ [2] https://gohugo.io/documentation/ [3] https://docs.asciidoctor.org/home/ Approved by: doceng, core
171 lines
5.6 KiB
Groff
171 lines
5.6 KiB
Groff
.\" Copyright (c) 1983, 1991, 1993
|
||
.\" The Regents of the University of California. All rights reserved.
|
||
.\"
|
||
.\" 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.
|
||
.\"
|
||
.\" @(#)dir.5 8.3 (Berkeley) 4/19/94
|
||
.\" %FreeBSD: src/share/man/man5/dir.5,v 1.20 2003/09/10 19:24:35 ru Exp %
|
||
.\"
|
||
.\" $FreeBSD$
|
||
.\"
|
||
.\" WORD: graft Àܹç [mount.8]
|
||
.Dd April 19, 1994
|
||
.Dt DIR 5
|
||
.Os
|
||
.Sh ̾¾Î
|
||
.Nm dir ,
|
||
.Nm dirent
|
||
.Nd ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È
|
||
.Sh ½ñ¼°
|
||
.In dirent.h
|
||
.Sh ²òÀâ
|
||
¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢ÅÚÂæ¤È¤Ê¤ëµ²±ÇÞÂΤξܺ٤ò±£Êä·¡¢
|
||
¥Õ¥¡¥¤¥ë¤ò¥°¥ë¡¼¥×ʬ¤±¤¹¤ëÊØÍø¤Ê³¬ÁؼêÃʤòÄ󶡤·¤Þ¤¹¡£
|
||
¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¤Ï¡¢¤½¤Î
|
||
.Xr inode 5
|
||
¥¨¥ó¥È¥êÃæ¤Î¥Õ¥é¥°¤Ë¤è¤Ã¤Æ¡¢Ä̾ï¥Õ¥¡¥¤¥ë¤È¶èÊ̤µ¤ì¤Þ¤¹¡£
|
||
¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¤Ï¥ì¥³¡¼¥É (¥Ç¥£¥ì¥¯¥È¥ê¥¨¥ó¥È¥ê) ¤«¤é¹½À®¤µ¤ì¡¢
|
||
³Æ¥ì¥³¡¼¥É¤Ï¥Õ¥¡¥¤¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤È¤½¤Î¥Õ¥¡¥¤¥ë¼«¿È¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò
|
||
´Þ¤ó¤Ç¤¤¤Þ¤¹¡£
|
||
¥Ç¥£¥ì¥¯¥È¥ê¥¨¥ó¥È¥ê¤Ï¡¢Ä̾ï¥Õ¥¡¥¤¥ë¤ÈƱÍͤˡ¢
|
||
¾¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò´Þ¤à¤³¤È¤â¤¢¤ê¤Þ¤¹¡£
|
||
¤½¤Î¤è¤¦¤ÊÆþ¤ì»Ò¤Ë¤Ê¤Ã¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ï¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤È¸Æ¤Ð¤ì¤Þ¤¹¡£
|
||
¤³¤Î¤è¤¦¤Ë¤·¤Æ¥Ç¥£¥ì¥¯¥È¥ê¤È¥Õ¥¡¥¤¥ë¤Î³¬Áع½Â¤¤¬·ÁÀ®¤µ¤ì¡¢
|
||
¤³¤Î¹½Â¤¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È¸Æ¤Ð¤ì¤Þ¤¹ (¤¢¤ë¤¤¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Ä¥ê¡¼
|
||
¤È¸Æ¤Ð¤ì¤Þ¤¹)¡£
|
||
.\" °Ê²¼¤Î3¹Ô¤Ï±Ñ¸ìÈǤ˥³¥á¥ó¥È¤Î·Á¤Ç´Þ¤Þ¤ì¤Æ¤¤¤¿¤â¤Î
|
||
.\" An entry in this tree,
|
||
.\" nested or not nested,
|
||
.\" is a pathname.
|
||
.Pp
|
||
³Æ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¤Ë¤ÏÆÃÊ̤ʥǥ£¥ì¥¯¥È¥ê¥¨¥ó¥È¥ê¤¬ 2 ¤Ä¤¢¤ê¤Þ¤¹¡£
|
||
1 ¤Ä¤Ï¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¼«¿È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¡¢¥É¥Ã¥È
|
||
.Ql .\&
|
||
¤È¸Æ¤Ð¤ì¤Þ¤¹¡£
|
||
¤â¤¦ 1 ¤Ä¤Ï¼«Ê¬¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¡¢¥É¥Ã¥È¥É¥Ã¥È
|
||
.Ql \&..\&
|
||
¤È¸Æ¤Ð¤ì¤Þ¤¹¡£
|
||
¥É¥Ã¥È¤È¥É¥Ã¥È¥É¥Ã¥È¤Ï͸ú¤Ê¥Ñ¥¹Ì¾¤Ç¤¹¤¬¡¢
|
||
¥·¥¹¥Æ¥à¤Î¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê
|
||
.Ql /
|
||
¤Ë¤Ï¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¤Ê¤¯¡¢¥É¥Ã¥È¥É¥Ã¥È¤Ï¥É¥Ã¥È¤ÈƱ¤¸¤¯¼«Ê¬¼«¿È¤ò»Ø¤·¤Þ¤¹¡£
|
||
.Pp
|
||
¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÏÉáÄ̤Υǥ£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¡¢
|
||
¤½¤Î¾å¤ËʪÍý¥Ç¥£¥¹¥¯¤ä¤½¤Î¥Ç¥£¥¹¥¯Ãæ¤Îʬ³ä¤µ¤ì¤¿Îΰè¤È¤¤¤Ã¤¿
|
||
¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥ª¥Ö¥¸¥§¥¯¥È¤òÀܹ礷¤Þ¤¹
|
||
(
|
||
.Xr mount 2
|
||
¤ª¤è¤Ó
|
||
.Xr mount 8
|
||
»²¾È)¡£
|
||
.Pp
|
||
¥Ç¥£¥ì¥¯¥È¥ê¥¨¥ó¥È¥ê¤Î·Á¼°¤Ï¥Õ¥¡¥¤¥ë
|
||
.In sys/dirent.h
|
||
¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹
|
||
(¤³¤ì¤ÏľÀÜ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤«¤é¤Ï¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤Þ¤»¤ó):
|
||
.Bd -literal
|
||
#ifndef _SYS_DIRENT_H_
|
||
#define _SYS_DIRENT_H_
|
||
|
||
#include <machine/ansi.h>
|
||
|
||
/*
|
||
* dirent ¹½Â¤ÂΤϡ¢getdirentries(2) ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÇÊÖ¤µ¤ì¤ë
|
||
* ¥Ç¥£¥ì¥¯¥È¥ê¥¨¥ó¥È¥ê¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤òÄêµÁ¤·¤Þ¤¹¡£
|
||
*
|
||
* ¥Ç¥£¥ì¥¯¥È¥ê¥¨¥ó¥È¥ê¤Ï¤½¤ÎÀèÆ¬¤Ë dirent ¹½Â¤ÂΤò»ý¤Á¤Þ¤¹¡£dirent
|
||
* ¹½Â¤ÂÎ¤Ï inode Èֹ桢¤½¤Î¥¨¥ó¥È¥ê¤ÎŤµ¡¢¤½¤Î¥¨¥ó¥È¥ê¤Ë´Þ¤Þ¤ì¤ë
|
||
* ̾Á°¤ÎŤµ¤òÊÝ»ý¤·¤Þ¤¹¡£¤½¤Î¸å¤Ë¡¢¥Ê¥ë¤Ç 4 ¥Ð¥¤¥È¶³¦¤Þ¤Ç¥Ñ¥Ç¥£¥ó¥°
|
||
* ¤·¤¿Ì¾Á°¤¬Â³¤¤Þ¤¹¡£Ì¾Á°¤ÏÁ´¤Æ¥Ê¥ë¤Ç½ªÃ¼¤·¤Æ¤¤¤ë¤³¤È¤¬Êݾڤµ¤ì¤Þ¤¹¡£
|
||
* ¥Ç¥£¥ì¥¯¥È¥êÃæ¤Î̾Á°¤ÎŤµ¤ÎºÇÂçÃÍ¤Ï MAXNAMLEN ¤Ç¤¹¡£
|
||
*/
|
||
|
||
struct dirent {
|
||
__uint32_t d_fileno; /* ¥¨¥ó¥È¥ê¤Î¥Õ¥¡¥¤¥ëÈÖ¹æ */
|
||
__uint16_t d_reclen; /* ¤³¤Î¥ì¥³¡¼¥É¤ÎŤµ */
|
||
__uint8_t d_type; /* ¥Õ¥¡¥¤¥ë¥¿¥¤¥×¡¢°Ê²¼»²¾È */
|
||
__uint8_t d_namlen; /* d_name ¤Îʸ»úÎóĹ */
|
||
#ifdef _POSIX_SOURCE
|
||
char d_name[255 + 1]; /* ̾Á°¤Ï¤³¤ÎŤµ¤ò±Û¤¨¤Æ¤Ï¤Ê¤é¤Ê¤¤ */
|
||
#else
|
||
#define MAXNAMLEN 255
|
||
char d_name[MAXNAMLEN + 1]; /* ̾Á°¤Ï¤³¤ÎŤµ¤ò±Û¤¨¤Æ¤Ï¤Ê¤é¤Ê¤¤ */
|
||
#endif
|
||
|
||
};
|
||
|
||
/*
|
||
* ¥Õ¥¡¥¤¥ë¥¿¥¤¥×
|
||
*/
|
||
#define DT_UNKNOWN 0
|
||
#define DT_FIFO 1
|
||
#define DT_CHR 2
|
||
#define DT_DIR 4
|
||
#define DT_BLK 6
|
||
#define DT_REG 8
|
||
#define DT_LNK 10
|
||
#define DT_SOCK 12
|
||
#define DT_WHT 14
|
||
|
||
/*
|
||
* stat ¹½Â¤Âη¿¤È¥Ç¥£¥ì¥¯¥È¥ê·¿¤È¤ÎÊÑ´¹
|
||
*/
|
||
#define IFTODT(mode) (((mode) & 0170000) >> 12)
|
||
#define DTTOIF(dirtype) ((dirtype) << 12)
|
||
|
||
/*
|
||
* _GENERIC_DIRSIZ ¥Þ¥¯¥í¤Ï¥Ç¥£¥ì¥¯¥È¥ê¥¨¥ó¥È¥ê¤òÊÝ»ý¤¹¤ëºÇ¾®¥ì¥³¡¼¥ÉŤò
|
||
* Í¿¤¨¤Þ¤¹¡£¤³¤ì¤Ï d_name ¥Õ¥£¡¼¥ë¥É°Ê³°¤Î dirent ¹½Â¤ÂΤζõ´Ö¤Ë¡¢¥Ê¥ë
|
||
* ¥Ð¥¤¥È¤Ç½ªÃ¼¤µ¤ì¤ë̾Á°¤Î¤¿¤á¤Ë½½Ê¬¤Ê¶õ´Ö (dp->d_namlen+1) ¤ò²Ã¤¨¤¿¤â¤Î
|
||
* ¤ò¡¢4 ¥Ð¥¤¥Èñ°Ì¤Ç·«¤ê¾å¤²¤¿¤â¤Î¤Ç¤¹¡£
|
||
*/
|
||
#define _GENERIC_DIRSIZ(dp) \
|
||
((sizeof (struct dirent) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
|
||
|
||
#ifdef _KERNEL
|
||
#define GENERIC_DIRSIZ(dp) _GENERIC_DIRSIZ(dp)
|
||
#endif
|
||
|
||
#endif /* !_SYS_DIRENT_H_ */
|
||
.Ed
|
||
.Sh ´ØÏ¢¹àÌÜ
|
||
.Xr fs 5 ,
|
||
.Xr inode 5
|
||
.Sh ¥Ð¥°
|
||
struct dirent ¤Î¥á¥ó¥Ð d_type ¤Ï
|
||
.Fx
|
||
¸ÇͤǤ¢¤ê¡¢
|
||
»ÈÍѤϥݡ¼¥¿¥Ö¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
|
||
¤Þ¤¿¡¢ÆÃÄê¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¢Î㤨¤Ð cd9660 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¼ºÇÔ¤·¤Þ¤¹¡£
|
||
.Sh Îò»Ë
|
||
¥Õ¥¡¥¤¥ë·Á¼°
|
||
.Nm
|
||
¤Ï
|
||
.At v7
|
||
¤ÇÅо줷¤Þ¤·¤¿¡£
|