summaryrefslogtreecommitdiff
path: root/third_party/FreeRTOS/Demo/Common/FileSystem/FatFs-0.7e/doc/ja/getfree.html
blob: 23751c6476c1fadd64e6e4ac7f6c81d7d8988906 (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
<!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="stylesheet" href="../css_j.css" type="text/css" media="screen" title="ELM Default">
<title>FatFs - f_getfree</title>
</head>

<body>

<div class="para">
<h2>f_getfree</h2>
<p>_hCu̖gpNX^𓾂܂B</p>
<pre>
FRESULT f_getfree (
  const XCHAR* <em>Path</em>,       /* ΏۃhCũ[gEfBNg */
  DWORD* <em>Clusters</em>,         /* 󂫃NX^i[ϐւ̃|C^ */
  FATFS** <em>FileSystemObject</em> /* t@CEVXeEIuWFNgw|C^ւ̃|C^ */
);
</pre>
</div>

<div class="para">
<h4></h4>
<dl class="par">
<dt>Path</dt>
<dd>Ώۂ̘_hCũ[gfBNg<a href="filename.html">pX</a><tt>'\0'</tt>ŏI镶ւ̃|C^w肵܂B</dd>
<dt>Clusters</dt>
<dd>󂫃NX^i[<tt>DWORD</tt>ϐւ̃|C^w肵܂B</dd>
<dt>FileSystemObject</dt>
<dd>ΏۃhCũt@CEVXeEIuWFNgw|C^Ԃ܂B</dd>
</dl>
</div>


<div class="para">
<h4>߂l</h4>
<dl class="ret">
<dt>FR_OK (0)</dt>
<dd>IB<tt>*Clusters</tt>ɋ󂫃NX^Ԃ܂B</dd>
<dt>FR_INVALID_DRIVE</dt>
<dd>hCuԍsB</dd>
<dt>FR_NOT_READY</dt>
<dd>fBAZbgĂȂȂǁAhCus\ԁB</dd>
<dt>FR_DISK_ERR</dt>
<dd>fBXNEG[ɂ鎸sB</dd>
<dt>FR_INT_ERR</dt>
<dd>sFAT\܂͓G[ɂ鎸sB</dd>
<dt>FR_NOT_ENABLED</dt>
<dd>̘_hCuɃ[NEGA^ĂȂB</dd>
<dt>FR_NO_FILESYSTEM</dt>
<dd>fBXNɗLFATp[e[V‚ȂB</dd>
</dl>
</div>


<div class="para">
<h4></h4>
<p>_hCű󂫃NX^擾܂BԂꂽt@CEVXeEIuWFNg<tt>csize</tt>oNX^̃ZN^Ă̂ŁAɎۂ̋󂫃TCYvZł܂BFAT32{[ɂẮAFSINFȌԂɂĂ͕smȒlԂAɎԂ肷”\܂B</p>
</div>


<div class="para">
<h4>Ή</h4>
<p><tt>_FS_READONLY == 0</tt>ŁA<tt>_FS_MINIMIZE == 0</tt>̂Ƃgp”\łB</p>
</div>


<div class="para">
<h4>gp</h4>
<pre>
    FATFS *fs;
    DWORD fre_clust, fre_sect, tot_sect;


    /* Get drive information and free clusters */
    res = f_getfree("/", &amp;fre_clust, &amp;fs);
    if (res) die(res);

    /* Get total sectors and free sectors */
    tot_sect = (fs->max_clust - 2) * fs->csize;
    fre_sect = fre_clust * fs->csize;

    /* Print free space in unit of KB (assuming 512B/sector) */
    printf("%lu KB total drive space.\n"
           "%lu KB available.\n",
           fre_sect / 2, tot_sect / 2);
</pre>
</div>


<div class="para">
<h4>Q</h4>
<tt><a href="sfatfs.html">FATFS</a></tt>
</div>

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