summaryrefslogtreecommitdiff
path: root/fatfs/doc/ja/readdir.html
blob: bd1c34e58f95eb3b4a92069c7e1e741170f4c6bf (plain)
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="up" title="FatFs" href="../00index_j.html">
<link rel="alternate" hreflang="en" title="English" href="../en/readdir.html">
<link rel="stylesheet" href="../css_j.css" type="text/css" media="screen" title="ELM Default">
<title>FatFs - f_readdir</title>
</head>

<body>

<div class="para func">
<h2>f_readdir</h2>
<p>�f�B���N�g�����ڂ�ǂݏo���܂��B</p>
<pre>
FRESULT f_readdir (
  DIR* <span class="arg">dp</span>,      <span class="c">/* [IN] �f�B���N�g���E�u�W�F�N�g�\���̂ւ̃|�C���^ */</span>
  FILINFO* <span class="arg">fno</span>  <span class="c">/* [OUT] �t�@�C�����\���̂ւ̃|�C���^ */</span>
);
</pre>
</div>

<div class="para arg">
<h4>����</h4>
<dl class="par">
<dt>dp</dt>
<dd>�L���ȃf�B���N�g���E�I�u�W�F�N�g�\���̂ւ̃|�C���^���w�肵�܂��B</dd>
<dt>fno</dt>
<dd>�ǂݏo�����f�B���N�g�����ڂ��i�[����t�@�C�����\���̂ւ̃|�C���^���w�肵�܂��B</dd>
</dl>
</div>


<div class="para ret">
<h4>�߂�l</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
<a href="rc.html#ie">FR_INT_ERR</a>,
<a href="rc.html#nr">FR_NOT_READY</a>,
<a href="rc.html#io">FR_INVALID_OBJECT</a>,
<a href="rc.html#tm">FR_TIMEOUT</a>,
<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
</p>
</div>


<div class="para desc">
<h4>���</h4>
<p>�f�B���N�g���̍���(�t�@�C���ƃf�B���N�g��)�������ǂݏo���܂��B���̊֐����J��Ԃ����s���邱�Ƃɂ�肻�̃f�B���N�g���̑S�Ă̍��ڂ�ǂݏo�����Ƃ��ł��܂��B������t�@�C�����̏ڍׂɂ‚��Ă� <tt>FILINFO</tt>�\���̂��Q�Ƃ��Ă��������B�S�Ă̍��ڂ��ǂݏo����A�ǂݏo�����ڂ����������Ƃ��́A<tt>fname[]</tt>�����o�Ƀk�������񂪕Ԃ���܂��B<tt class="arg">fno</tt>�Ƀk���E�|�C���^���w�肷��ƁA���̃f�B���N�g���̃��[�h�E�C���f�b�N�X��擪�Ɋ����߂��܂��B�܂��A���̊֐��͎��Ɏ����悤�Ɋ֘A����\���I�v�V�����ɂ�蓮�삪�ς��܂��B</p>
<p>�h�b�g�E�G���g��("."�A"..")�́A���΃p�X���L���ȂƂ�(<tt>_FS_RPATH &gt;= 1</tt>)�ɂ̂ݏo�͂Ɍ���܂��B</p>
<p>LFN�@�\���L���Ȏ��́A���̊֐��̌Ăяo���ɐ旧����<tt>FILINFO</tt>�\���̂�<tt>lfname</tt>��<tt>lfsize</tt>���L���Ȓl�ŏ���������Ă��Ȃ���΂Ȃ�܂���B<tt>lfname</tt>��LFN���i�[����o�b�t�@�ŁA<tt>lfsize</tt>�͂��̃o�b�t�@�̗v�f���ł��BLFN��ǂݏo���K�v���Ȃ��Ƃ��́A<tt>lfname</tt>�Ƀk���E�|�C���^���Z�b�g���Ă��������B���̏����Ɉ�‚ł��Y������ꍇ�́ALFN�i�[�o�b�t�@�Ƀk�������񂪕Ԃ���܂��B</p>
<ul>
<li>�f�B���N�g�����ڂ�LFN��񂪑��݂��Ȃ��B</li>
<li>LFN�̒����ɑ΂���LFN�i�[�o�b�t�@�܂���LFN����o�b�t�@�̃T�C�Y���s�\���B</li>
<li>LFN�Ɍ��݂�OEM�R�[�h�ɑ��݂��Ȃ��������܂܂�Ă���B(��Unicode�\���̂Ƃ�)</li>
</ul>
<p>�܂��A�f�B���N�g�����ڂ�LFN��񂪑��݂��Ȃ��ꍇ�́A<tt>fname[]</tt>�ɉp���������܂܂��ꍇ������܂��B</p>
</div>


<div class="para comp">
<h4>�Ή����</h4>
<p><tt>_FS_MINIMIZE &lt;= 1</tt>�̂Ƃ��Ɏg�p�”\�ł��B</p>
</div>


<div class="para use">
<h4>�g�p��</h4>
<pre>
FRESULT scan_files (
    char* path        <span class="c">/* �J�n�m�[�h (���[�N�G���A�Ƃ��Ă��g�p) */</span>
)
{
    FRESULT res;
    FILINFO fno;
    DIR dir;
    int i;
    char *fn;   <span class="c">/* ��Unicode�\����z�� */</span>
<span class="k">#if</span> _USE_LFN
    static char lfn[_MAX_LFN + 1];
    fno.lfname = lfn;
    fno.lfsize = sizeof lfn;
<span class="k">#endif</span>


    res = f_opendir(&amp;dir, path);                       <span class="c">/* �f�B���N�g�����J�� */</span>
    if (res == FR_OK) {
        i = strlen(path);
        for (;;) {
            res = f_readdir(&amp;dir, &amp;fno);                   <span class="c">/* �f�B���N�g�����ڂ�1�“ǂݏo�� */</span>
            if (res != FR_OK || fno.fname[0] == 0) break;  <span class="c">/* �G���[�܂��͍��ږ����̂Ƃ��͔����� */</span>
            if (fno.fname[0] == '.') continue;             <span class="c">/* �h�b�g�G���g���͖��� */</span>
<span class="k">#if</span> _USE_LFN
            fn = *fno.lfname ? fno.lfname : fno.fname;
<span class="k">#else</span>
            fn = fno.fname;
<span class="k">#endif</span>
            if (fno.fattrib &amp; AM_DIR) {                    <span class="c">/* �f�B���N�g�� */</span>
                sprintf(&amp;path[i], "/%s", fn);
                res = scan_files(path);
                if (res != FR_OK) break;
                path[i] = 0;
            } else {                                       <span class="c">/* �t�@�C�� */</span>
                printf("%s/%s\n", path, fn);
            }
        }
        f_closedir(&amp;dir);
    }

    return res;
}
</pre>
</div>


<div class="para ref">
<h4>�Q��</h4>
<p><tt><a href="opendir.html">f_opendir</a>, <a href="closedir.html">f_closedir</a>, <a href="stat.html">f_stat</a>, <a href="sfileinfo.html">FILINFO</a>, <a href="sdir.html">DIR</a></tt></p>
</div>

<p class="foot"><a href="../00index_j.html">�߂�</a></p>
</body>
</html>