From a6163888f3c56123b1db313743c6147ba498732c Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Fri, 8 Aug 2014 14:42:07 +0300 Subject: Add third_party libs --- .../FileSystem/FatFs-0.7e/doc/ja/getfree.html | 101 +++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 third_party/FreeRTOS/Demo/Common/FileSystem/FatFs-0.7e/doc/ja/getfree.html (limited to 'third_party/FreeRTOS/Demo/Common/FileSystem/FatFs-0.7e/doc/ja/getfree.html') diff --git a/third_party/FreeRTOS/Demo/Common/FileSystem/FatFs-0.7e/doc/ja/getfree.html b/third_party/FreeRTOS/Demo/Common/FileSystem/FatFs-0.7e/doc/ja/getfree.html new file mode 100644 index 0000000..23751c6 --- /dev/null +++ b/third_party/FreeRTOS/Demo/Common/FileSystem/FatFs-0.7e/doc/ja/getfree.html @@ -0,0 +1,101 @@ + + + + + + + +FatFs - f_getfree + + + + +
+

f_getfree

+

論理ドライブ上の未使用クラスタ数を得ます。

+
+FRESULT f_getfree (
+  const XCHAR* Path,       /* 対象ドライブのルート・ディレクトリ */
+  DWORD* Clusters,         /* 空きクラスタ数を格納する変数へのポインタ */
+  FATFS** FileSystemObject /* ファイル・システム・オブジェクトを指すポインタへのポインタ */
+);
+
+
+ +
+

引数

+
+
Path
+
対象の論理ドライブのルートディレクトリのパス名が入った'\0'で終わる文字列へのポインタを指定します。
+
Clusters
+
空きクラスタ数を格納するDWORD変数へのポインタを指定します。
+
FileSystemObject
+
対象ドライブのファイル・システム・オブジェクトを指すポインタが返されます。
+
+
+ + +
+

戻り値

+
+
FR_OK (0)
+
正常終了。*Clustersに空きクラスタ数が返されます。
+
FR_INVALID_DRIVE
+
ドライブ番号が不正。
+
FR_NOT_READY
+
メディアがセットされていないなど、物理ドライブが動作不能状態。
+
FR_DISK_ERR
+
ディスク・エラーによる失敗。
+
FR_INT_ERR
+
不正なFAT構造または内部エラーによる失敗。
+
FR_NOT_ENABLED
+
その論理ドライブにワーク・エリアが与えられていない。
+
FR_NO_FILESYSTEM
+
ディスク上に有効なFATパーテーションが見つからない。
+
+
+ + +
+

解説

+

論理ドライブ上の空きクラスタ数を取得します。返されたファイル・システム・オブジェクトのcsizeメンバがクラスタあたりのセクタ数を示しているので、これを元に実際の空きサイズが計算できます。FAT32ボリュームにおいては、FSINFOの状態によっては不正確な値を返したり、処理に時間がかかったりする可能性があります。

+
+ + +
+

対応情報

+

_FS_READONLY == 0で、且つ_FS_MINIMIZE == 0のとき使用可能です。

+
+ + +
+

使用例

+
+    FATFS *fs;
+    DWORD fre_clust, fre_sect, tot_sect;
+
+
+    /* Get drive information and free clusters */
+    res = f_getfree("/", &fre_clust, &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);
+
+
+ + +
+

参照

+FATFS +
+ +

戻る

+ + -- cgit v1.3.1