fatfs v0.08 May 15, 2010:
- Added a memory configuration option. (_USE_LFN) - Added file lock feature. (_FS_SHARE) - Added fast seek feature. (_USE_FASTSEEK) - Changed some types on the API, XCHAR->TCHAR. - Changed fname member in the FILINFO structure on Unicode cfg. - String functions support UTF-8 encoding files on Unicode cfg.
This commit is contained in:
1 parent
e6cd91ca0b
commit
46155916b1
92 files changed
+2469
-1589
No files matched your search
+10
-9
@@ -4,6 +4,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="up" title="FatFs" href="../00index_e.html">
|
||||
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/getfree.html">
|
||||
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
|
||||
<title>FatFs - f_getfree</title>
|
||||
</head>
|
||||
@@ -15,9 +16,9 @@
|
||||
<p>The f_getfree function gets number of the free clusters.</p>
|
||||
<pre>
|
||||
FRESULT f_getfree (
|
||||
const XCHAR* <em>Path</em>, /* Root directory of the drive */
|
||||
DWORD* <em>Clusters</em>, /* Pointer to the variable to store number of free clusters */
|
||||
FATFS** <em>FileSystemObject</em> /* Pointer to pointer to file system object */
|
||||
const TCHAR* <em>Path</em>, <span>/* Logical drive number */</span>
|
||||
DWORD* <em>Clusters</em>, <span>/* Pointer to the variable to store number of free clusters */</span>
|
||||
FATFS** <em>FileSystemObject</em> <span>/* Pointer to pointer to file system object */</span>
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
@@ -26,7 +27,7 @@ FRESULT f_getfree (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>Path</dt>
|
||||
<dd>Pinter to the null-terminated string that specifies the <a href="filename.html">root directory</a> of the logical drive.</dd>
|
||||
<dd>Pinter to the null-terminated string that specifies the <a href="filename.html">logical drive</a>.</dd>
|
||||
<dt>Clusters</dt>
|
||||
<dd>Pointer to the DWORD variable to store number of free clusters.</dd>
|
||||
<dt>FileSystemObject</dt>
|
||||
@@ -51,7 +52,7 @@ FRESULT f_getfree (
|
||||
<dt>FR_NOT_ENABLED</dt>
|
||||
<dd>The logical drive has no work area.</dd>
|
||||
<dt>FR_NO_FILESYSTEM</dt>
|
||||
<dd>There is no valid FAT partition on the disk.</dd>
|
||||
<dd>There is no valid FAT partition on the drive.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
@@ -75,15 +76,15 @@ FRESULT f_getfree (
|
||||
DWORD fre_clust, fre_sect, tot_sect;
|
||||
|
||||
|
||||
/* Get drive information and free clusters */
|
||||
res = f_getfree("/", &fre_clust, &fs);
|
||||
<span>/* Get volume information and free clusters of drive 1 */</span>
|
||||
res = f_getfree("1:", &fre_clust, &fs);
|
||||
if (res) die(res);
|
||||
|
||||
/* Get total sectors and free sectors */
|
||||
<span>/* Get total sectors and free sectors */</span>
|
||||
tot_sect = (fs->max_clust - 2) * fs->csize;
|
||||
fre_sect = fre_clust * fs->csize;
|
||||
|
||||
/* Print free space in unit of KB (assuming 512B/sector) */
|
||||
<span>/* Print free space in unit of KB (assuming 512 bytes/sector) */</span>
|
||||
printf("%lu KB total drive space.\n"
|
||||
"%lu KB available.\n",
|
||||
fre_sect / 2, tot_sect / 2);
|
||||
|
||||
Reference in new issue
Block a user