Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-doc
Path: blob/main/documentation/manual-pages/ja/man5/dir.5
18093 views
.\" 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
���о줷�ޤ�����