summaryrefslogtreecommitdiff
path: root/fatfs
diff options
context:
space:
mode:
authorLeo C2014-11-17 14:47:05 +0100
committerLeo C2014-11-17 14:47:05 +0100
commit7b78a5a287827db9e9b16286f3604aef69b37c5c (patch)
tree6a3788876f5d701f42663f0a498068f18e39df79 /fatfs
parent5366852335044c1e68a5c32548d3051cc943552f (diff)
downloadz180-stamp-7b78a5a287827db9e9b16286f3604aef69b37c5c.zip
Import fatfs R0.10cfatfs-0.10c
Diffstat (limited to 'fatfs')
-rw-r--r--fatfs/doc/00index_e.html19
-rw-r--r--fatfs/doc/00index_j.html78
-rw-r--r--fatfs/doc/en/appnote.html18
-rw-r--r--fatfs/doc/en/dinit.html6
-rw-r--r--fatfs/doc/en/dioctl.html19
-rw-r--r--fatfs/doc/en/dread.html9
-rw-r--r--fatfs/doc/en/dstat.html10
-rw-r--r--fatfs/doc/en/dwrite.html4
-rw-r--r--fatfs/doc/en/eof.html2
-rw-r--r--fatfs/doc/en/error.html2
-rw-r--r--fatfs/doc/en/filename.html14
-rw-r--r--fatfs/doc/en/getcwd.html2
-rw-r--r--fatfs/doc/en/mkfs.html48
-rw-r--r--fatfs/doc/en/mount.html2
-rw-r--r--fatfs/doc/en/rc.html6
-rw-r--r--fatfs/doc/en/readdir.html4
-rw-r--r--fatfs/doc/en/sfile.html2
-rw-r--r--fatfs/doc/en/sfileinfo.html4
-rw-r--r--fatfs/doc/en/stat.html40
-rw-r--r--fatfs/doc/img/app3.c2
-rw-r--r--fatfs/doc/img/mkfatimg.zipbin0 -> 686662 bytes
-rw-r--r--fatfs/doc/ja/appnote.html110
-rw-r--r--fatfs/doc/ja/chdir.html30
-rw-r--r--fatfs/doc/ja/chdrive.html22
-rw-r--r--fatfs/doc/ja/chmod.html40
-rw-r--r--fatfs/doc/ja/close.html26
-rw-r--r--fatfs/doc/ja/closedir.html26
-rw-r--r--fatfs/doc/ja/dinit.html22
-rw-r--r--fatfs/doc/ja/dioctl.html86
-rw-r--r--fatfs/doc/ja/dread.html47
-rw-r--r--fatfs/doc/ja/dstat.html22
-rw-r--r--fatfs/doc/ja/dwrite.html50
-rw-r--r--fatfs/doc/ja/eof.html28
-rw-r--r--fatfs/doc/ja/error.html28
-rw-r--r--fatfs/doc/ja/fattime.html30
-rw-r--r--fatfs/doc/ja/fdisk.html48
-rw-r--r--fatfs/doc/ja/filename.html34
-rw-r--r--fatfs/doc/ja/forward.html72
-rw-r--r--fatfs/doc/ja/getcwd.html28
-rw-r--r--fatfs/doc/ja/getfree.html40
-rw-r--r--fatfs/doc/ja/getlabel.html34
-rw-r--r--fatfs/doc/ja/gets.html36
-rw-r--r--fatfs/doc/ja/lseek.html76
-rw-r--r--fatfs/doc/ja/mkdir.html24
-rw-r--r--fatfs/doc/ja/mkfs.html80
-rw-r--r--fatfs/doc/ja/mount.html50
-rw-r--r--fatfs/doc/ja/open.html96
-rw-r--r--fatfs/doc/ja/opendir.html28
-rw-r--r--fatfs/doc/ja/printf.html44
-rw-r--r--fatfs/doc/ja/putc.html32
-rw-r--r--fatfs/doc/ja/puts.html32
-rw-r--r--fatfs/doc/ja/rc.html18
-rw-r--r--fatfs/doc/ja/read.html36
-rw-r--r--fatfs/doc/ja/readdir.html60
-rw-r--r--fatfs/doc/ja/rename.html32
-rw-r--r--fatfs/doc/ja/sdir.html28
-rw-r--r--fatfs/doc/ja/setlabel.html38
-rw-r--r--fatfs/doc/ja/sfatfs.html48
-rw-r--r--fatfs/doc/ja/sfile.html34
-rw-r--r--fatfs/doc/ja/sfileinfo.html48
-rw-r--r--fatfs/doc/ja/size.html26
-rw-r--r--fatfs/doc/ja/stat.html67
-rw-r--r--fatfs/doc/ja/sync.html26
-rw-r--r--fatfs/doc/ja/tell.html26
-rw-r--r--fatfs/doc/ja/truncate.html22
-rw-r--r--fatfs/doc/ja/unlink.html28
-rw-r--r--fatfs/doc/ja/utime.html32
-rw-r--r--fatfs/doc/ja/write.html36
-rw-r--r--fatfs/doc/updates.txt6
-rw-r--r--fatfs/src/00readme.txt7
-rw-r--r--fatfs/src/diskio.c66
-rw-r--r--fatfs/src/diskio.h16
-rw-r--r--fatfs/src/ff.c439
-rw-r--r--fatfs/src/ff.h9
-rw-r--r--fatfs/src/ffconf.h224
-rw-r--r--fatfs/src/option/cc932.c6
-rw-r--r--fatfs/src/option/cc936.c4
-rw-r--r--fatfs/src/option/cc949.c4
-rw-r--r--fatfs/src/option/cc950.c4
-rw-r--r--fatfs/src/option/ccsbcs.c2
-rw-r--r--fatfs/src/option/syscall.c38
81 files changed, 1635 insertions, 1407 deletions
diff --git a/fatfs/doc/00index_e.html b/fatfs/doc/00index_e.html
index aa249b1..9dc9d8e 100644
--- a/fatfs/doc/00index_e.html
+++ b/fatfs/doc/00index_e.html
@@ -4,7 +4,10 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="cache-control" content="no-cache">
-<meta name="description" content="Open source FAT file system module for embedded projects">
+<meta name="description" content="Open source FAT file system for embedded projects">
+<link rel="start" title="Site Top" href="../../">
+<link rel="up" title="Freewares" href="../../fsw_e.html">
+<link rel="alternate" hreflang="en" title="Original" href="http://elm-chan.org/fsw/ff/00index_e.html">
<link rel="alternate" hreflang="ja" title="Japanese version" href="00index_j.html">
<link rel="stylesheet" href="css_e.css" type="text/css" media="screen" title="ELM Default">
<title>FatFs - Generic FAT File System Module</title>
@@ -16,7 +19,7 @@
<div class="abst">
<img src="img/layers.png" class="rset" width="245" height="255" alt="layer">
-<p>FatFs is a generic FAT file system module for small embedded systems. The FatFs is written in compliance with ANSI C and completely separated from the disk I/O layer. Therefore it is independent of hardware architecture. It can be incorporated into small microcontrollers with limited resource, such as AVR, 8051, PIC, ARM, Z80, 68k and etc. Also Petit FatFs module for tiny microcontrollers is available <a href="http://elm-chan.org/fsw/ff/00index_p.html">here</a>.</p>
+<p>FatFs is a generic FAT file system module for small embedded systems. The FatFs module is written in compliance with ANSI C (C89) and completely separated from the disk I/O layer. Therefore it is independent of the platform. It can be incorporated into small microcontrollers with limited resource, such as 8051, PIC, AVR, ARM, Z80, 78K and etc. Also Petit FatFs module for tiny microcontrollers is available <a href="http://elm-chan.org/fsw/ff/00index_p.html">here</a>↗.</p>
<h4>Features</h4>
<ul>
@@ -28,8 +31,8 @@
<li>Multiple volumes (physical drives and partitions).</li>
<li>Multiple ANSI/OEM code pages including DBCS.</li>
<li>Long file name support in ANSI/OEM or Unicode.</li>
- <li>RTOS support.</li>
- <li>Multiple sector size support.</li>
+ <li>RTOS support for multi-task operation.</li>
+ <li>Multiple sector size support upto 4KB.</li>
<li>Read-only, minimized API, I/O buffer and etc...</li>
</ul>
</li>
@@ -81,7 +84,7 @@
<div class="para">
<h3>Device Control Interface</h3>
-<p>Since the FatFs module is a file system driver, it is completely separated from physical devices, such as memory card, harddisk and any type of storage devices. The low level device control module is not a part of FatFs module. FatFs accesses the storage device via a simple interface described below. These functions are provided by implementer. Sample implementations for some platforms are also available in the downloads.</p>
+<p>Since the FatFs module is a file system layer, it is completely separated from physical devices, such as memory card, harddisk and any type of storage devices. FatFs accesses the storage device via a simple interface described below. The low level device control module is not a part of FatFs module. It is provided by implementer. Also sample implementations for some platforms are available in the downloads.</p>
<ul>
<li><a href="en/dstat.html">disk_status</a> - Get device status</li>
<li><a href="en/dinit.html">disk_initialize</a> - Initialize device</li>
@@ -97,17 +100,17 @@
<h3>Resources</h3>
<p>The FatFs module is a free software opened for education, research and development. You can use, modify and/or redistribute it for personal projects or commercial products without any restriction under your responsibility. For further information, refer to the application note.</p>
<ul>
+ <li><a href="http://elm-chan.org/fsw/ff/00index_e.html"><em>FatFs Home Page</em></a>↗</li>
<li><a href="http://elm-chan.org/fsw/ff/bd/"><em>FatFs User Forum</em></a>↗</li>
<li>Read first: <a href="en/appnote.html">FatFs module application note</a></li>
- <li>Latest Information: <a href="http://elm-chan.org/fsw/ff/00index_e.html">http://elm-chan.org/fsw/ff/00index_e.html</a>↗</li>
+ <li><a href="http://stm32f4-discovery.com/2014/07/library-21-read-sd-card-fatfs-stm32f4xx-devices/">Read SD card with FatFs on STM32F4xx devices by Tilen Majerle</a>↗ (Quick and easy implementation for STM32F4-Discovery)</li>
<li><a href="http://nemuisan.blog.bai.ne.jp/">Nemuisan's Blog</a>↗ (Well written implementations for STM32F/SDIO and LPC2300/MCI)</li>
<li><a href="http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/arm_memcards/index.html">ARM-Projects by Martin THOMAS</a>↗ (Examples for LPC2000, AT91SAM and STM32)</li>
- <li><a href="http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx">FAT32 Specification by Microsoft</a>↗ (The reference document on FAT file system)</li>
+ <li><a href="http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx">FAT32 Specification by Microsoft</a>↗ (The authorized document on FAT file system)</li>
<li><a href="http://elm-chan.org/docs/fat.html">The basics of FAT file system [ja]</a>↗</li>
<li><a href="http://elm-chan.org/docs/mmc/mmc_e.html">How to Use MMC/SDC</a>↗</li>
<li><a href="img/rwtest.png">Benchmark 1</a> (ATmega64/9.2MHz with MMC via SPI, HDD/CFC via GPIO)</li>
<li><a href="img/rwtest2.png">Benchmark 2</a> (LPC2368/72MHz with MMC via MCI)</li>
- <li><a href="http://members.jcom.home.ne.jp/felm/fd.mp4">Demo movie of an application</a> (this project is in ffsample.zip/lpc23xx)</li>
</ul>
</div>
diff --git a/fatfs/doc/00index_j.html b/fatfs/doc/00index_j.html
index d5496e9..b13297d 100644
--- a/fatfs/doc/00index_j.html
+++ b/fatfs/doc/00index_j.html
@@ -4,34 +4,35 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="cache-control" content="no-cache">
-<meta name="description" content="組み込みシステム向け汎用FATファイル・システム">
+<meta name="description" content="組み込みシステム向け汎用FATファイルシステム">
<link rel="start" title="Site Top" href="../../index_j.html">
<link rel="up" title="Freewares" href="../../fsw.html">
-<link rel="alternate" hreflang="en" title="英文" href="00index_e.html">
+<link rel="alternate" hreflang="ja" title="オリジナル版" href="http://elm-chan.org/fsw/ff/00index_j.html">
+<link rel="alternate" hreflang="en" title="英文版" href="00index_e.html">
<link rel="stylesheet" href="css_j.css" type="text/css" media="screen" title="ELM Default">
-<title>FatFs 汎用FATファイルシステム・モジュール</title>
+<title>FatFs 汎用FATファイルシステム モジュール</title>
</head>
<body>
-<h1>FatFs 汎用FATファイルシステム・モジュール</h1>
+<h1>FatFs 汎用FATファイルシステム モジュール</h1>
<hr>
<div class="abst">
<img src="img/layers.png" class="rset" width="245" height="255" alt="layer">
-<p>FatFsは小規模な組み込みシステム向けの汎用FATファイルシステム・モジュールです。ANSI C準拠でハードウェア・アーキテクチャには依存しないので、必要なワーク・エリアが確保できれば、8051, PIC, AVR, SH, Z80, 68k, H8, ARMなど安価なマイコンでも使用可能です。FatFsをシュリンクした<a href="http://elm-chan.org/fsw/ff/00index_p.html">ぷちFatFs</a>↗もあります。</p>
+<p>FatFsは小規模な組み込みシステム向けの汎用FATファイルシステム モジュールです。ANSI C(C89)準拠でハードウェア アーキテクチャには依存しないので、必要なワーク エリアが確保できれば、8051, PIC, AVR, SH, Z80, 68k, H8, ARMなど安価なマイコンでも使用可能です。このほか、FatFsを極小マイコン向けにシュリンクした<a href="http://elm-chan.org/fsw/ff/00index_p.html">ぷちFatFs</a>↗ もあります。</p>
<h4>FatFsモジュールの特徴</h4>
<ul>
- <li>Windows互換 FATファイル・システム</li>
+ <li>Windows互換 FATファイル システム</li>
<li>プラットフォーム非依存</li>
<li>コンパクトなコードとRAM使用量</li>
<li>多くの構成オプション:
<ul>
<li>複数のボリューム(物理ドライブ・区画)</li>
- <li>DBCSを含む複数のANSI/OEMコード・ページ</li>
- <li>長いファイル名(LFN) (Unicode APIも選択可)</li>
+ <li>DBCSを含む複数のANSI/OEMコード ページの選択</li>
+ <li>長いファイル名(LFN)への対応</li>
<li>マルチタスク関連</li>
- <li>マルチ・セクタ・サイズ</li>
- <li>リード・オンリー構成、一部APIの削除、バッファ構成、その他…</li>
+ <li>マルチ セクタ サイズ</li>
+ <li>リード オンリー構成、一部APIの削除、バッファ構成、その他…</li>
</ul>
</li>
</ul>
@@ -39,50 +40,50 @@
<div class="para">
-<h3>上位レイヤ・インターフェース</h3>
-<p>FatFsモジュールは、アプリケーション・レイヤに対し、次のファイル操作関数(API)を提供します。つまり、このリストはFatFsにできることをシンプルに示しています。</p>
+<h3>上位レイヤ インターフェース</h3>
+<p>FatFsモジュールは、アプリケーション レイヤに対し、次のファイル操作関数(API)を提供します。つまり、このリストはFatFsにできることをシンプルに示しています。</p>
<ul>
<li><a href="ja/mount.html">f_mount</a> - ワークエリアの登録・抹消</li>
<li><a href="ja/open.html">f_open</a> - ファイルのオープン・作成</li>
<li><a href="ja/close.html">f_close</a> - ファイルのクローズ</li>
<li><a href="ja/read.html">f_read</a> - ファイルの読み出し</li>
<li><a href="ja/write.html">f_write</a> - ファイルの書き込み</li>
- <li><a href="ja/lseek.html">f_lseek</a> - リード/ライト・ポインタの移動, ファイルの拡張</li>
- <li><a href="ja/truncate.html">f_truncate</a> - ファイル・サイズの切り詰め</li>
+ <li><a href="ja/lseek.html">f_lseek</a> - リード/ライト ポインタの移動, ファイルの拡張</li>
+ <li><a href="ja/truncate.html">f_truncate</a> - ファイル サイズの切り詰め</li>
<li><a href="ja/sync.html">f_sync</a> - キャッシュされたデータのフラッシュ</li>
- <li><a href="ja/forward.html">f_forward</a> - ファイル・データをストリーム関数に転送</li>
- <li><a href="ja/stat.html">f_stat</a> - ファイル/サブ・ディレクトリの存在チェックと情報の取得</li>
+ <li><a href="ja/forward.html">f_forward</a> - ファイル データをストリーム関数に転送</li>
+ <li><a href="ja/stat.html">f_stat</a> - ファイル/サブ ディレクトリの存在チェックと情報の取得</li>
<li><a href="ja/opendir.html">f_opendir</a> - ディレクトリのオープン</li>
<li><a href="ja/closedir.html">f_closedir</a> - ディレクトリのクローズ</li>
<li><a href="ja/readdir.html">f_readdir</a> - ディレクトリの読み出し</li>
- <li><a href="ja/mkdir.html">f_mkdir</a> - サブ・ディレクトリの作成</li>
- <li><a href="ja/unlink.html">f_unlink</a> - ファイル/サブ・ディレクトリの削除</li>
- <li><a href="ja/chmod.html">f_chmod</a> - ファイル/サブ・ディレクトリの属性の変更</li>
- <li><a href="ja/utime.html">f_utime</a> - ファイル/サブ・ディレクトリのタイムスタンプの変更</li>
- <li><a href="ja/rename.html">f_rename</a> - ファイル/サブ・ディレクトリの名前の変更・移動</li>
- <li><a href="ja/chdir.html">f_chdir</a> - カレント・ディレクトリの変更</li>
- <li><a href="ja/chdrive.html">f_chdrive</a> - カレント・ドライブの変更</li>
- <li><a href="ja/getcwd.html">f_getcwd</a> - カレント・ディレクトリの取得</li>
+ <li><a href="ja/mkdir.html">f_mkdir</a> - サブ ディレクトリの作成</li>
+ <li><a href="ja/unlink.html">f_unlink</a> - ファイル/サブ ディレクトリの削除</li>
+ <li><a href="ja/chmod.html">f_chmod</a> - ファイル/サブ ディレクトリの属性の変更</li>
+ <li><a href="ja/utime.html">f_utime</a> - ファイル/サブ ディレクトリのタイムスタンプの変更</li>
+ <li><a href="ja/rename.html">f_rename</a> - ファイル/サブ ディレクトリの名前の変更・移動</li>
+ <li><a href="ja/chdir.html">f_chdir</a> - カレント ディレクトリの変更</li>
+ <li><a href="ja/chdrive.html">f_chdrive</a> - カレント ドライブの変更</li>
+ <li><a href="ja/getcwd.html">f_getcwd</a> - カレント ディレクトリの取得</li>
<li><a href="ja/getfree.html">f_getfree</a> - ボリューム空き領域の取得</li>
- <li><a href="ja/getlabel.html">f_getlabel</a> - ボリューム・ラベルの取得</li>
- <li><a href="ja/setlabel.html">f_setlabel</a> - ボリューム・ラベルの設定</li>
+ <li><a href="ja/getlabel.html">f_getlabel</a> - ボリューム ラベルの取得</li>
+ <li><a href="ja/setlabel.html">f_setlabel</a> - ボリューム ラベルの設定</li>
<li><a href="ja/mkfs.html">f_mkfs</a> - 論理ドライブのフォーマット</li>
<li><a href="ja/fdisk.html">f_fdisk</a> - 物理ドライブの分割</li>
<li><a href="ja/gets.html">f_gets</a> - 文字列の読み出し</li>
<li><a href="ja/putc.html">f_putc</a> - 文字の書き込み</li>
<li><a href="ja/puts.html">f_puts</a> - 文字列の書き込み</li>
<li><a href="ja/printf.html">f_printf</a> - 書式化文字列の書き込み</li>
- <li><a href="ja/tell.html">f_tell</a> - 現在のリード/ライト・ポインタの取得</li>
+ <li><a href="ja/tell.html">f_tell</a> - 現在のリード/ライト ポインタの取得</li>
<li><a href="ja/eof.html">f_eof</a> - ファイル終端の有無の取得</li>
- <li><a href="ja/size.html">f_size</a> - ファイル・サイズの取得</li>
+ <li><a href="ja/size.html">f_size</a> - ファイル サイズの取得</li>
<li><a href="ja/error.html">f_error</a> - ファイルのエラーの有無の取得</li>
</ul>
</div>
<div class="para">
-<h3>下位レイヤ・インターフェース</h3>
-<p>FatFsモジュールは、単なるファイル・システム・レイヤなので、ストレージ・デバイス制御レイヤは含まれません。使用するストレージに対応した制御関数は、ユーザによって提供される必要があります。FatFsモジュールは、下位レイヤに対し少なくとも次のインターフェースを要求します。OS関連機能を有効にしたときは、これに加えてプロセス/メモリ関連関数も必要になります。サンプル・プロジェクトに下位レイヤの実装例を示します。</p>
+<h3>下位レイヤ インターフェース</h3>
+<p>FatFsモジュールは、単なるファイル システム レイヤなので、ストレージ デバイス制御レイヤは含まれません。使用するプラットフォームやストレージ デバイスに対応した制御関数は、ユーザによって提供される必要があります。FatFsモジュールは、下位レイヤに対し標準的には次のインターフェースを要求します。拡張機能、たとえばOS関連機能を有効にしたときは、加えてプロセス/メモリ操作関数なども必要になります。サンプル プロジェクトに下位レイヤの実装例を示します。</p>
<ul>
<li><a href="ja/dstat.html">disk_status</a> - デバイスの状態取得</li>
<li><a href="ja/dinit.html">disk_initialize</a> - デバイスの初期化</li>
@@ -96,18 +97,19 @@
<div class="para">
<h3>資料</h3>
-<p>FatFsモジュールはフリー・ソフトウェアとして教育・研究・開発用に公開しています。どのような利用目的(個人利用から商用まで)でも使用・改変・配布について一切の制限はありませんが、全て利用者の責任の下での利用とします。詳しくはアプリケーション・ノートを参照してください。</p>
+<p>FatFsモジュールはフリー ソフトウェアとして教育・研究・開発用に公開しています。どのような利用目的(個人利用から商用まで)でも使用・改変・配布について一切の制限はありませんが、全て利用者の責任の下での利用とします。詳しくはアプリケーション ノートを参照してください。</p>
<ul>
- <li><a href="http://elm-chan.org/fsw/ff/bd/"><em>FatFsユーザ・フォーラム</em></a>↗</li>
- <li>最初に読め: <a href="ja/appnote.html">FatFsモジュール・アプリケーション・ノート</a></li>
- <li>最新版: <a href="http://elm-chan.org/fsw/ff/00index_j.html">http://elm-chan.org/fsw/ff/00index_j.html</a>↗</li>
+ <li><a href="http://elm-chan.org/fsw/ff/00index_j.html"><em>FatFsホームページ</em></a>↗</li>
+ <li><a href="http://elm-chan.org/fsw/ff/bd/"><em>FatFsユーザ フォーラム</em></a>↗</li>
+ <li>最初に読め: <a href="ja/appnote.html">FatFsモジュール アプリケーション ノート</a></li>
+ <li><a href="http://stm32f4-discovery.com/2014/07/library-21-read-sd-card-fatfs-stm32f4xx-devices/">Read SD card with FatFs on STM32F4xx devices by Tilen Majerle</a>↗ (Quick and easy implementation for STM32F4-Discovery)</li>
<li><a href="http://nemuisan.blog.bai.ne.jp/">ねむいさんのぶろぐ</a>↗ (Well written implementations for STM32F/SDIO and LPC2300/MCI)</li>
<li><a href="http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/arm_memcards/index.html">ARM-Projects by Martin THOMAS</a>↗ (Examples for LPC2000, AT91SAM and STM32)</li>
- <li><a href="http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx">FATファイル・システム仕様書 by Microsoft</a>↗ (The reference document on FAT file system)</li>
- <li><a href="http://elm-chan.org/docs/fat.html">FATファイル・システム概要</a>↗ (↑を読むためのガイド)</li>
+ <li><a href="http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx">FATファイルシステム仕様 by Microsoft</a>↗ (The reference document on FAT file system)</li>
+ <li><a href="http://elm-chan.org/docs/fat.html">FATファイルシステム概要</a>↗ (↑を読むためのガイド)</li>
<li><a href="http://elm-chan.org/docs/mmc/mmc.html">MMCの使いかた</a>↗</li>
- <li><a href="img/rwtest.png">パフォーマンス・テスト1</a> (ATmega64/9.2MHz with MMC via SPI, HDD/CFC via GPIO)</li>
- <li><a href="img/rwtest2.png">パフォーマンス・テスト2</a> (LPC2368/72MHz with MMC via MCI)</li>
+ <li><a href="img/rwtest.png">パフォーマンス テスト1</a> (ATmega64/9.2MHz with MMC via SPI, HDD/CFC via GPIO)</li>
+ <li><a href="img/rwtest2.png">パフォーマンス テスト2</a> (LPC2368/72MHz with MMC via MCI)</li>
</ul>
</div>
diff --git a/fatfs/doc/en/appnote.html b/fatfs/doc/en/appnote.html
index 7f5ad89..fee2af9 100644
--- a/fatfs/doc/en/appnote.html
+++ b/fatfs/doc/en/appnote.html
@@ -54,7 +54,7 @@ The FatFs module assumes that size of char/short/long are 8/16/32 bit and int is
<tr><td>disk_write<br>get_fattime<br>disk_ioctl (CTRL_SYNC)</td><td>_FS_READONLY == 0</td></tr>
<tr><td>disk_ioctl (GET_SECTOR_COUNT)<br>disk_ioctl (GET_BLOCK_SIZE)</td><td>_USE_MKFS == 1</td></tr>
<tr><td>disk_ioctl (GET_SECTOR_SIZE)</td><td>_MAX_SS != _MIN_SS</td></tr>
-<tr><td>disk_ioctl (CTRL_ERASE_SECTOR)</td><td>_USE_ERASE == 1</td></tr>
+<tr><td>disk_ioctl (CTRL_TRIM)</td><td>_USE_TRIM == 1</td></tr>
<tr><td>ff_convert<br>ff_wtoupper</td><td>_USE_LFN &gt;= 1</td><td>Unicode support functions.<br>Available in option/unicode.c.</td></tr>
<tr><td>ff_cre_syncobj<br>ff_del_syncobj<br>ff_req_grant<br>ff_rel_grant</td><td>_FS_REENTRANT == 1</td><td rowspan="2">O/S dependent functions.<br>Samples available in option/syscall.c.</td></tr>
<tr><td>ff_mem_alloc<br>ff_mem_free</td><td>_USE_LFN == 3</td></tr>
@@ -98,7 +98,7 @@ _USE_STRFUNC 0 (Disable string functions)
_USE_MKFS 0 (Disable f_mkfs function)
_USE_FORWARD 0 (Disable f_forward function)
_USE_FASTSEEK 0 (Disable fast seek feature)
-_CODE_PAGE 932 (Japanese Shift-JIS)
+_CODE_PAGE 932 (Japanese Shift_JIS)
_USE_LFN 0 (Disable LFN feature)
_MAX_SS 512 (Fixed sector size)
_FS_RPATH 0 (Disable relative path feature)
@@ -151,17 +151,17 @@ _FS_LOCK 0 (Disable file lock control)
<div class="para" id="lfn">
<h3>Long File Name</h3>
-<p>FatFs module supports LFN (long file name). The two different file names, SFN (short file name) and LFN, of a file is transparent on the API except for <tt>f_readdir()</tt> function. The LFN feature is disabled by default. To enable it, set <tt>_USE_LFN</tt> to 1, 2 or 3, and add <tt>option/unicode.c</tt> to the project. The LFN feature requiers a certain working buffer in addition. The buffer size can be configured by <tt>_MAX_LFN</tt> according to the available memory. The length of an LFN will reach up to 255 characters, so that the <tt>_MAX_LFN</tt> should be set to 255 for full featured LFN operation. If the size of working buffer is insufficient for the input file name, the file function fails with <tt>FR_INVALID_NAME</tt>. When enable the LFN feature with re-entrant configuration, <tt>_USE_LFN</tt> must be set to 2 or 3. In this case, the file function allocates the working buffer on the stack or heap. The working buffer occupies <tt>(_MAX_LFN + 1) * 2</tt> bytes.</p>
+<p>FatFs module supports LFN (long file name). The two different file names, SFN (short file name) and LFN, of a file is transparent on the API except for <tt>f_readdir()</tt> function. The LFN feature is disabled by default. To enable it, set <tt>_USE_LFN</tt> to 1, 2 or 3, and add <tt>option/unicode.c</tt> to the project. The LFN feature requiers a certain working buffer in addition. The buffer size can be configured by <tt>_MAX_LFN</tt> according to the available memory. The length of an LFN will reach up to 255 characters, so that the <tt>_MAX_LFN</tt> should be set to 255 for full featured LFN operation. If the size of working buffer is insufficient for the input file name, the file function fails with <tt>FR_INVALID_NAME</tt>. When enable the LFN feature under re-entrant configuration, <tt>_USE_LFN</tt> must be set to 2 or 3. In this case, the file function allocates the working buffer on the stack or heap. The working buffer occupies <tt>(_MAX_LFN + 1) * 2</tt> bytes.</p>
<table class="lst2 rset">
<caption>LFN cfg on ARM7TDMI</caption>
<tr><th>Code page</th><th>Program size</th></tr>
<tr><td>SBCS</td><td>+3.7K</td></tr>
-<tr><td>932(Shift-JIS)</td><td>+62K</td></tr>
+<tr><td>932(Shift_JIS)</td><td>+62K</td></tr>
<tr><td>936(GBK)</td><td>+177K</td></tr>
<tr><td>949(Korean)</td><td>+139K</td></tr>
<tr><td>950(Big5)</td><td>+111K</td></tr>
</table>
-<p>When the LFN feature is enabled, the module size will be increased depends on the selected code page. Right table shows how many bytes increased when LFN feature is enabled with some code pages. Especially, in the CJK region, tens of thousands of characters are being used. Unfortunately, it requires a huge OEM-Unicode bidirectional conversion table and the module size will be drastically increased that shown in the table. As the result, the FatFs with LFN feature with those code pages will not able to be implemented to most 8-bit microcontrollers.</p>
+<p>When the LFN feature is enabled, the module size will be increased depends on the selected code page. Right table shows how many bytes increased when LFN feature is enabled with some code pages. Especially, in the CJK region, tens of thousands of characters are being used. Unfortunately, it requires a huge OEM-Unicode bidirectional conversion table and the module size will be drastically increased as shown in the table. As the result, the FatFs with LFN feature with those code pages will not able to be implemented to most 8-bit microcontrollers.</p>
<p>Note that the LFN feature on the FAT file system is a patent of Microsoft Corporation. This is not the case on FAT32 but most FAT32 drivers come with the LFN feature. FatFs can swich the LFN feature off by configuration option. When enable LFN feature on the commercial products, a license from Microsoft may be required depends on the final destination.</p>
</div>
@@ -181,7 +181,7 @@ _FS_LOCK 0 (Disable file lock control)
<div class="para" id="dup">
<h3>Duplicated File Access</h3>
<p>FatFs module does not support the read/write collision control of duplicated open to a file. The duplicated open is permitted only when each of open method to a file is read mode. The duplicated open with one or more write mode to a file is always prohibited, and also open file must not be renamed and deleted. A violation of these rules can cause data colluption.</p>
-<p>The file lock control can also be available by <tt>_FS_LOCK</tt> option. The value defines the number of open objects to manage simultaneously. In this case, if any open, rename or remove that violating the file shareing rule that described above is attempted, the file function will fail with <tt>FR_LOCKED</tt>. If number of open objects, files and sub-directories, gets larger than <tt>_FS_LOCK</tt>, the <tt>f_open(), f_optndir()</tt> function will fail with <tt>FR_TOO_MANY_OPEN_FILES</tt>.</p>
+<p>The file lock control can be enabled by <tt>_FS_LOCK</tt> option. The value of option defines the number of open objects to manage simultaneously. In this case, if any open, rename or remove that violating the file shareing rule that described above is attempted, the file function will fail with <tt>FR_LOCKED</tt>. If number of open objects, files and sub-directories, is equal to <tt>_FS_LOCK</tt>, an extra <tt>f_open(), f_optndir()</tt> function will fail with <tt>FR_TOO_MANY_OPEN_FILES</tt>.</p>
</div>
<div class="para" id="fs1">
@@ -196,7 +196,7 @@ _FS_LOCK 0 (Disable file lock control)
<p>Figure 3. Fully sector aligned read<br>
<img src="../img/f3.png" width="490" height="119" alt="">
</p>
-<p>The file I/O buffer is a sector buffer to read/write a partial data on the sector. The sector buffer is either file private sector buffer on each file object or shared sector buffer in the file system object. The buffer configuration option <tt>_FS_TINY</tt> determins which sector buffer is used for the file data transfer. When tiny buffer (1) is selected, data memory consumption is reduced 512 bytes each file object. In this case, FatFs module uses only a sector buffer in the file system object for file data transfer and FAT/directory access. The disadvantage of the tiny buffer configuration is: the FAT data cached in the sector buffer will be lost by file data transfer and it must be reloaded at every cluster boundary. However it will be suitable for most application from view point of the decent performance and low memory comsumption.</p>
+<p>The file I/O buffer is a sector buffer to read/write a partial data on the sector. The sector buffer is either file private sector buffer on each file object or shared sector buffer in the file system object. The buffer configuration option <tt>_FS_TINY</tt> determins which sector buffer is used for the file data transfer. When tiny buffer configuration (1) is selected, data memory consumption is reduced <tt>_MAX_SS</tt> bytes each file object. In this case, FatFs module uses only a sector buffer in the file system object for file data transfer and FAT/directory access. The disadvantage of the tiny buffer configuration is: the FAT data cached in the sector buffer will be lost by file data transfer and it must be reloaded at every cluster boundary. However it will be suitable for most application from view point of the decent performance and low memory comsumption.</p>
<p>Figure 1 shows that a partial sector, sector misaligned part of the file, is transferred via the file I/O buffer. At long data transfer shown in Figure 2, middle of transfer data that covers one or more sector is transferred to the application buffer directly. Figure 3 shows that the case of entier transfer data is aligned to the sector boundary. In this case, file I/O buffer is not used. On the direct transfer, the maximum extent of sectors are read with <tt>disk_read()</tt> function at a time but the multiple sector transfer is divided at cluster boundary even if it is contiguous.</p>
<p>Therefore taking effort to sector aligned read/write accesss eliminates buffered data transfer and the read/write performance will be improved. Besides the effect, cached FAT data will not be flushed by file data transfer at the tiny configuration, so that it can achieve same performance as non-tiny configuration with small memory footprint.</p>
</div>
@@ -211,7 +211,7 @@ Figure 6. Comparison between Multiple/Single Sector Write<br>
</div>
<p>The write throughput of the flash memory media becomes the worst at single sector write transaction. The write throughput increases as the number of sectors per a write transaction. This effect more appers at faster interface speed and the performance ratio often becomes grater than ten. <a href="../img/rwtest2.png">This graph</a> is clearly explaining how fast is multiple block write (W:16K, 32 sectors) than single block write (W:100, 1 sector), and also larger card tends to be slow at single block write. The number of write transactions also affects the life time of the flash memory media. Therefore the application program should write the data in large block as possible. The ideal write chunk size and alighment is size of sector, and size of cluster is the best. Of course all layers between the application and the storage device must have consideration on multiple sector write, however most of open-source disk drivers lack it. Do not split a multiple sector write request into single sector write transactions or the write throughput gets poor. Note that FatFs module and its sample disk drivers supprt multiple sector read/write feature. </p>
<h4>Forcing Memory Erase</h4>
-<p>When remove a file with <tt>f_remove()</tt> function, the data clusters occupied by the file are marked 'free' on the FAT. But the data sectors containing the file data are not that applied any process, so that the file data left occupies a part of the flash memory array as 'live block'. If the file data is forced erased on removing the file, those data blocks will be turned in to the free block pool. This may skip internal block erase operation to the data block on next write operation. As the result the write performance might be improved. FatFs can manage this feature by setting <tt>_USE_ERASE</tt> to 1. Note that this is an expectation of internal process of the flash memory storage and not that always effective. Also <tt>f_remove()</tt> function will take a time when remove a large file. Most applications will not need this feature.</p>
+<p>When remove a file with <tt>f_remove()</tt> function, the data clusters occupied by the file are marked 'free' on the FAT. But the data sectors containing the file data are not that applied any process, so that the file data left occupies a part of the flash memory array as 'live block'. If the file data is forced erased on removing the file, those data blocks will be turned in to the free block pool. This may skip internal block erase operation to the data block on next write operation. As the result the write performance might be improved. FatFs can manage this feature by setting <tt>_USE_TRIM</tt> to 1. Note that this is an expectation of internal process of the flash memory storage and not that always effective. Also <tt>f_remove()</tt> function will take a time when remove a large file. Most applications will not need this feature.</p>
</div>
<div class="para" id="critical">
@@ -267,7 +267,7 @@ Figure 5. Minimized critical section<br>
/ * Redistributions of source code must retain the above copyright notice.
/
/-----------------------------------------------------------------------------/</pre>
-<p>Therefore FatFs license is one of the BSD-style licenses but there is a significant feature. Because FatFs is for embedded projects, the conditions of redistributions in binary form, such as embedded code, hex file, binary library or any forms without source code, are not specified in order to extend usability for commercial products. The documentation of the distributions need not include about FatFs and its license document, and it may also. This is equivalent to the BSD 1-Clause License. Of course FatFs is compatible with the projects under GNU GPL. When redistribute the FatFs with any modification or branch it as a folk, the license can also be changed to GNU GPL or BSD-style license.</p>
+<p>Therefore FatFs license is one of the BSD-style licenses but there is a significant feature. Because FatFs is mainly intended for embedded projects, the redistributions in binary form, such as embedded code or any forms without source code, need not to explain about FatFs in order to extend usability for commercial products. The documentation of the distributions need not include about FatFs and its license documents, and it may also. This is equivalent to the BSD 1-Clause License. Of course FatFs is compatible with the projects under GNU GPL. When redistribute the FatFs with any modification or branch it as a fork, the license can also be changed to GNU GPL, BSD-style license or any free software licenses that not conflict with FatFs license.</p>
</div>
<p class="foot"><a href="../00index_e.html">Return</a></p>
diff --git a/fatfs/doc/en/dinit.html b/fatfs/doc/en/dinit.html
index c22df47..a85eecd 100644
--- a/fatfs/doc/en/dinit.html
+++ b/fatfs/doc/en/dinit.html
@@ -25,19 +25,19 @@ DSTATUS disk_initialize (
<h4>Parameter</h4>
<dl class="par">
<dt>pdrv</dt>
-<dd>Physical drive number to identify the target device.</dd>
+<dd>Physical drive number to identify the target device. Always zero at single drive system.</dd>
</dl>
</div>
<div class="para ret">
<h4>Return Values</h4>
-<p>This function returns a disk status as the result. For details of the disk status, refer to the <a href="dstat.html">disk_status()</a> function.</p>
+<p>This function returns the current drive status flags as the result. For details of the drive status, refer to the <a href="dstat.html">disk_status()</a> function.</p>
</div>
<div class="para desc">
<h4>Description</h4>
-<p>This function initializes a storage device and put it ready to generic read/write data. When the function succeeded, <tt>STA_NOINIT</tt> flag in the return value is cleared.</p>
+<p>This function initializes the storage device and put it ready to generic read/write. When the function succeeded, <tt>STA_NOINIT</tt> flag in the return value is cleared.</p>
<p><em>Application program MUST NOT call this function, or FAT structure on the volume can be broken. To re-initialize the file system, use <tt>f_mount()</tt> function instead.</em> This function is called at volume mount process by FatFs module to manage the media change.</p>
</div>
diff --git a/fatfs/doc/en/dioctl.html b/fatfs/doc/en/dioctl.html
index 8cd30af..8fe62ec 100644
--- a/fatfs/doc/en/dioctl.html
+++ b/fatfs/doc/en/dioctl.html
@@ -57,19 +57,19 @@ DRESULT disk_ioctl (
<table class="lst">
<caption>Standard ioctl command used by FatFs</caption>
<tr><th>Command</th><th>Description</th></tr>
-<tr><td>CTRL_SYNC</td><td>Make sure that the device has finished pending write process. If the disk I/O module has a write back cache, the dirty buffers must be written back to the media immediately. Nothing to do for this command if each write operation to the media is completed within the <tt>disk_write()</tt> function. Required at <tt>_FS_READONLY == 0</tt>.</td></tr>
+<tr><td>CTRL_SYNC</td><td>Make sure that the device has finished pending write process. If the disk I/O module has a write back cache, the dirty buffers must be written back to the media immediately. Nothing to do for this command if each write operation to the media is completed within the <tt>disk_write()</tt> function.</td></tr>
<tr><td>GET_SECTOR_COUNT</td><td>Returns number of available sectors on the drive into the <tt>DWORD</tt> variable pointed by <tt class="arg">buff</tt>. This command is used by only <tt>f_mkfs()</tt> and <tt>f_fdisk()</tt> function to determine the volume/partition size to be created. Required at <tt>_USE_MKFS == 1</tt> or <tt>_MULTI_PARTITION == 1</tt>.</td></tr>
-<tr><td>GET_SECTOR_SIZE</td><td>Returns sector size of the media into the <tt>WORD</tt> variable pointed by <tt class="arg">buff</tt>. Valid return values of this command are 512, 1024, 2048 or 4096. This command is required at variable sector size configuration, <tt>_MAX_SS &gt; _MIN_SS</tt>. Never used at fixed sector size configuration, <tt>_MAX_SS == _MIN_SS</tt>, and it must work at that sector size.</td></tr>
-<tr><td>GET_BLOCK_SIZE</td><td>Returns erase block size of the flash memory in unit of sector into the <tt>DWORD</tt> variable pointed by <tt class="arg">buff</tt>. The allowable value is from 1 to 32768 in power of 2. Return 1 if the erase block size is unknown or disk media. This command is used by only <tt>f_mkfs()</tt> function and it attempts to align data area to the erase block boundary. Required at <tt>_USE_MKFS == 1</tt>.</td></tr>
-<tr><td>CTRL_ERASE_SECTOR</td><td>Informs device that the data on the block of sectors specified by a <tt>DWORD</tt> array {&lt;start sector&gt;, &lt;end sector&gt;} pointed by <tt class="arg">buff</tt> is no longer needed and may be erased. The device would force erased the memory block. This is a command similar to Trim command of ATA device. When this feature is not supported or not a flash memory media, nothing to do for this command. The FatFs does not check the result code and the file function is not affected even if the sectors ware not erased well. This command is called on removing a cluster chain and <tt>f_mkfs()</tt> function. Required at <tt>_USE_ERASE == 1</tt>.</td></tr>
+<tr><td>GET_SECTOR_SIZE</td><td>Returns sector size of the media into the <tt>WORD</tt> variable pointed by <tt class="arg">buff</tt>. Valid return values of this command are 512, 1024, 2048 and 4096. This command is required only at variable sector size configuration, <tt>_MAX_SS &gt; _MIN_SS</tt>. At fixed sector size configuration, <tt>_MAX_SS == _MIN_SS</tt>, this command is not used and the device must work at that sector size.</td></tr>
+<tr><td>GET_BLOCK_SIZE</td><td>Returns erase block size of the flash memory media in unit of sector into the <tt>DWORD</tt> variable pointed by <tt class="arg">buff</tt>. The allowable value is from 1 to 32768 in power of 2. Return 1 if the erase block size is unknown or non flash memory media. This command is used by only <tt>f_mkfs()</tt> function and it attempts to align data area to the erase block boundary. Required at <tt>_USE_MKFS == 1</tt>.</td></tr>
+<tr><td>CTRL_TRIM</td><td>Informs the device the data on the block of sectors that specified by <tt>DWORD</tt> array {&lt;start sector&gt;, &lt;end sector&gt;} pointed by <tt class="arg">buff</tt> is no longer needed and it may be erased. This is an identical command to Trim of ATA device. When this feature is not supported or not a flash memory device, nothing to do for this command. The FatFs does not check the result code and the file function is not affected even if the sector block was not erased well. This command is called on removing a cluster chain and <tt>f_mkfs()</tt> function. Required at <tt>_USE_TRIM == 1</tt>.</td></tr>
</table>
-<p>FatFs never uses any device dependent command and user defined command. Following table shows an example of non-standard commands usable for some applications.</p>
+<p>FatFs never uses any device dependent command nor user defined command. Following table shows an example of non-standard commands usable for some applications.</p>
<table class="lst">
<caption>Example of optional ioctl command</caption>
<tr><th>Command</th><th>Description</th></tr>
<tr><td>CTRL_FORMAT</td><td>Create a physical format on the media. If <tt class="arg">buff</tt> is not null, it is pointer to the call-back function for progress notification.</td></tr>
-<tr><td>CTRL_POWER_IDLE</td><td>Put the device idle state. <tt>STA_NOINIT</tt> in status flag may not be set if the device would go active state by generic read/write function.</td></tr>
+<tr><td>CTRL_POWER_IDLE</td><td>Put the device idle state. <tt>STA_NOINIT</tt> in status flag may not be set if the device goes active state by generic read/write function.</td></tr>
<tr><td>CTRL_POWER_OFF</td><td>Put the device off state. Shut-down the power to the device and deinitialize the device interface if needed. <tt>STA_NOINIT</tt> in status flag must be set. The device goes active state by <tt>disk_initialize()</tt> function.</td></tr>
<tr><td>CTRL_LOCK</td><td>Lock media eject mechanism.</td></tr>
<tr><td>CTRL_UNLOCK</td><td>Unlock media eject mechanism.</td></tr>
@@ -85,6 +85,13 @@ DRESULT disk_ioctl (
</table>
</div>
+
+<div class="para comp">
+<h4>QuickInfo</h4>
+<p>The disk_ioctl function is not needed when <tt>_FS_READONLY == 1</tt> and <tt>_MAX_SS == _MIN_SS</tt>.</p>
+</div>
+
+
<p class="foot"><a href="../00index_e.html">Return</a></p>
</body>
</html>
diff --git a/fatfs/doc/en/dread.html b/fatfs/doc/en/dread.html
index f81cf90..2e7c279 100644
--- a/fatfs/doc/en/dread.html
+++ b/fatfs/doc/en/dread.html
@@ -32,9 +32,9 @@ DRESULT disk_read (
<dt>buff</dt>
<dd>Pointer to the <em>byte array</em> to store the read data.</dd>
<dt>sector</dt>
-<dd>Start sector number in logical block address (LBA).</dd>
+<dd>Start sector number in 32-bit LBA.</dd>
<dt>count</dt>
-<dd>Number of sectors to read. FatFs specifis it in range of from 1 to 128.</dd>
+<dd>Number of sectors to read in range of from 1 to 128..</dd>
</dl>
</div>
@@ -56,9 +56,10 @@ DRESULT disk_read (
<div class="para desc">
<h4>Description</h4>
-<p>The memory address specified by <tt class="arg">buff</tt> is not that always aligned to word boundary because the type of argument is defined as <tt>BYTE*</tt>. The misaligned read/write request can occure at <a href="appnote.html#fs1">direct transfer</a>. If the bus architecture, especially DMA controller, does not allow misaligned memory access, it should be solved in this function. There are some workarounds described below to avoid this issue.</p>
+<p>The data read/write operation to the storage devices is done in unit of <em>sector</em>. FatFs supports the sector size in range of from 512 to 4096 bytes. When FatFs is configured to fixed sector size (<tt>_MIN_SS == MAX_SS</tt>, this will be the most case), the read/write function must work at that sector size. If variable sector size is selected (<tt>_MIN_SS &lt; MAX_SS</tt>), FatFs inquires the sector size with <tt>disk_ioctl()</tt> after initialization</tt>.
+<p>The memory address specified by <tt class="arg">buff</tt> is not that always aligned to word boundary because the argument is defined as <tt>BYTE*</tt>. The misaligned read/write request can occure at <a href="appnote.html#fs1">direct transfer</a>. If the bus architecture, especially DMA controller, does not allow misaligned memory access, it should be solved in this function. There are some workarounds described below to avoid this issue.</p>
<ul>
-<li>Convert word transfer to byte transfer in this function. - Recommended.</li>
+<li>Convert word transfer to byte transfer in this function if needed. - Recommended.</li>
<li>For <tt>f_read()</tt>, avoid long read request that includes a whole of sector. - Direct transfer will never occure.</li>
<li>For <tt>f_read(fp, buff, btr, &amp;br)</tt>, make sure that <tt>(((UINT)buff &amp; 3) == (f_tell(fp) &amp; 3))</tt> is true. - Word aligned direct transfer is guaranteed.</li>
</ul>
diff --git a/fatfs/doc/en/dstat.html b/fatfs/doc/en/dstat.html
index 5ae2775..c8204cc 100644
--- a/fatfs/doc/en/dstat.html
+++ b/fatfs/doc/en/dstat.html
@@ -13,7 +13,7 @@
<div class="para func">
<h2>disk_status</h2>
-<p>The disk_status function returns the current disk status.</p>
+<p>The disk_status function returns the current drive status.</p>
<pre>
DSTATUS disk_status (
BYTE <span class="arg">pdrv</span> <span class="c">/* [IN] Physical drive number */</span>
@@ -25,21 +25,21 @@ DSTATUS disk_status (
<h4>Parameter</h4>
<dl class="par">
<dt>pdrv</dt>
-<dd>Physical drive number to identify the target device.</dd>
+<dd>Physical drive number to identify the target device. Always zero at single drive system.</dd>
</dl>
</div>
<div class="para ret">
<h4>Return Values</h4>
-<p>The disk status is returned in combination of following flags. FatFs refers only <tt>STA_NOINIT</tt> and <tt>STA_PROTECT</tt>.</p>
+<p>The current drive status is returned in combination of status flags described below. FatFs refers only <tt>STA_NOINIT</tt> and <tt>STA_PROTECT</tt>.</p>
<dl class="ret">
<dt>STA_NOINIT</dt>
-<dd>Indicates that the device is not initialized. This flag is set on system reset, media removal or failure of <tt>disk_initialize()</tt> function. It is cleared on <tt>disk_initialize()</tt> function succeeded. Media change that occurs asynchronously must be captured and reflect it to the status flags, or auto-mount feature will not work correctly. When media change detection feature is not supported, application program needs to de-initialize the file system object with <tt>f_mount()</tt> function after the media change.</dd>
+<dd>Indicates that the device is not initialized. This flag is set on system reset, media removal or failure of <tt>disk_initialize()</tt> function. It is cleared on <tt>disk_initialize()</tt> function succeeded. Media change that occurs asynchronously must be captured and reflect it to the status flags, or auto-mount feature will not work correctly. If the system does not support media change detect feature, application program needs to force de-initialize the file system object with <tt>f_mount()</tt> function after the media change.</dd>
<dt>STA_NODISK</dt>
<dd>Indicates that no medium in the drive. This is always cleared on fixed disk drive. Note that FatFs does not refer this flag.</dd>
<dt>STA_PROTECT</dt>
-<dd>Indicates that the medium is write protected. This is always cleared on the drives without write protect feature. Not valid while no medium in the drive.</dd>
+<dd>Indicates that the medium is write protected. This is always cleared on the drives without write protect feature. Not valid if no medium in the drive.</dd>
</dl>
</div>
diff --git a/fatfs/doc/en/dwrite.html b/fatfs/doc/en/dwrite.html
index 67e3310..fd4bf48 100644
--- a/fatfs/doc/en/dwrite.html
+++ b/fatfs/doc/en/dwrite.html
@@ -32,9 +32,9 @@ DRESULT disk_write (
<dt>buff</dt>
<dd>Pointer to the <em>byte array</em> to be written. The size of data to be written is sector size * <tt class="arg">count</tt> bytes.</dd>
<dt>sector</dt>
-<dd>Start sector number in logical block address (LBA).</dd>
+<dd>Start sector number in 32-bit LBA.</dd>
<dt>count</dt>
-<dd>Number of sectors to write. FatFs specifis it in range of from 1 to 128.</dd>
+<dd>Number of sectors to write in range of from 1 to 128.</dd>
</dl>
</div>
diff --git a/fatfs/doc/en/eof.html b/fatfs/doc/en/eof.html
index 384c8d8..337697b 100644
--- a/fatfs/doc/en/eof.html
+++ b/fatfs/doc/en/eof.html
@@ -41,7 +41,7 @@ int f_eof (
<h4>Description</h4>
<p>In this revision, this function is implemented as a macro.</p>
<pre>
-<span class="k">#define</span> f_eof(fp) (((fp)->fptr) == ((fp)->fsize) ? 1 : 0)
+<span class="k">#define</span> f_eof(fp) ((int)((fp)->fptr == (fp)->fsize))
</pre>
</div>
diff --git a/fatfs/doc/en/error.html b/fatfs/doc/en/error.html
index 7405d9e..a14deb1 100644
--- a/fatfs/doc/en/error.html
+++ b/fatfs/doc/en/error.html
@@ -41,7 +41,7 @@ int f_error (
<h4>Description</h4>
<p>In this revision, this function is implemented as a macro.</p>
<pre>
-<span class="k">#define</span> f_error(fp) (((fp)->flag & FA__ERROR) ? 1 : 0)
+<span class="k">#define</span> f_error(fp) ((fp)->flag)
</pre>
</div>
diff --git a/fatfs/doc/en/filename.html b/fatfs/doc/en/filename.html
index 1209947..49dcc2d 100644
--- a/fatfs/doc/en/filename.html
+++ b/fatfs/doc/en/filename.html
@@ -17,9 +17,9 @@
<p>The format of path name on the FatFs module is similer to the filename specs of DOS/Windos as follows:</p>
<pre>"[<em>drive</em>:][/]<em>directory</em>/<em>file</em>"</pre>
<p>The FatFs module supports long file name (LFN) and 8.3 format file name (SFN). The LFN can be used when LFN feature is enabled (<tt>_USE_LFN &gt; 0</tt>). The sub directories are separated with a \ or / in the same way as DOS/Windows API. Duplicated separators are skipped and ignored. Only a difference is that the logical drive is specified in a numeral with a colon. When drive number is omitted, the drive number is assumed as <em>default drive</em> (drive 0 or current drive).</p>
-<p>Control characters (<tt>'\0'</tt> to <tt>'\x1F'</tt>) are recognized as end of the path name. Leading/embedded spaces in the path name are valid as a part of the name at LFN configuration but they are recognized as end of the path name at non-LFN configuration. Trailing spaces and dots are ignored.</p>
+<p>Control characters (<tt>'\0'</tt> to <tt>'\x1F'</tt>) are recognized as end of the path name. Leading/embedded spaces in the path name are valid as a part of the name at LFN configuration but the space is recognized as end of the path name at non-LFN configuration. Trailing spaces and dots are ignored at both configurations.</p>
<p>In default configuration (<tt>_FS_RPATH == 0</tt>), it does not have a concept of current directory like OS oriented file system. All objects on the volume are always specified in full path name that follows from the root directory. Dot directory names are not allowed. Heading separator is ignored and it can be exist or omitted. The default drive is fixed to drive 0.</p>
-<p>When relative path feature is enabled (<tt>_FS_RPATH == 1</tt>), specified path is followed from the root directory if a heading separator is exist. If not, it is followed from the current directory of the drive set with <a href="chdir.html">f_chdir</a> function. Dot names are also allowed for the path name. The default drive is the current drive set with <a href="chdrive.html">f_chdrive</a> function.</p>
+<p>When relative path feature is enabled (<tt>_FS_RPATH == 1</tt>), specified path is followed from the root directory if a heading separator is exist. If not, it is followed from the current directory of the drive set by <a href="chdir.html">f_chdir</a> function. Dot names are also allowed for the path name. The default drive is the current drive set by <a href="chdrive.html">f_chdrive</a> function.</p>
<table class="lst2">
<tr><td>Path name</td><td>_FS_RPATH == 0</td><td>_FS_RPATH == 1</td></tr>
<tr class="lst3"><td>file.txt</td><td>A file in the root directory of the drive 0</td><td>A file in the current directory of the current drive</td></tr>
@@ -35,13 +35,13 @@
<tr><td>dir1/..</td><td>Invalid name</td><td>The current directory</td></tr>
<tr><td>/..</td><td>Invalid name</td><td>The root directory (sticks the top level)</td></tr>
</table>
-<p>When option <tt>_STR_VOLUME_ID</tt> is specified, also pre-defined strings can be used as drive identifier in the path name instead of a numeral.</p>
+<p>When option <tt>_STR_VOLUME_ID</tt> is specified, also pre-defined strings can be used as drive identifier in the path name instead of a numeral. e.g. <tt>"sd:file1.txt"</tt> or <tt>"ram:swapfile.dat"</tt>.</p>
</div>
<p><br></p>
<div class="para" id="uni">
<h3>Unicode API</h3>
-<p>The path names are input/output in either ANSI/OEM code (SBCS/DBCS) or Unicode depends on the configuration options. The type of arguments which specify the file names are defined as <tt>TCHAR</tt>. It is an alias of <tt>char</tt> in default. The code set used to the file name string is ANSI/OEM specifid by <tt>_CODE_PAGE</tt>. When <tt>_LFN_UNICODE</tt> is set to 1, the type of the <tt>TCHAR</tt> is switched to <tt>WCHAR</tt> to support Unicode (UTF-16 encoding). In this case, the LFN feature is fully supported and the Unicode specific characters, such as ✝☪✡☸☭, can also be used for the path name. It also affects data types and encoding of the string I/O functions. To define literal strings, <tt>_T(s)</tt> and <tt>_TEXT(s)</tt> macro are available to select either ANSI/OEM or Unicode automatically. The code shown below is an example to define the literal strings.</p>
+<p>The path names are input/output in either ANSI/OEM code or Unicode depends on the configuration options. The type of arguments which specify the path names are defined as <tt>TCHAR</tt>. It is an alias of <tt>char</tt> by default. The code set used to the path name string is ANSI/OEM specifid by <tt>_CODE_PAGE</tt>. When <tt>_LFN_UNICODE</tt> is set to 1, the type of the <tt>TCHAR</tt> is switched to <tt>WCHAR</tt> to support Unicode (UTF-16 encoding). In this case, the LFN feature is fully supported and the Unicode specific characters, such as ✝☪✡☸☭, can also be used for the path name. It also affects data types and encoding of the string I/O functions. To define literal strings, <tt>_T(s)</tt> and <tt>_TEXT(s)</tt> macro are available to select either ANSI/OEM or Unicode automatically. The code shown below is an example to define the literal strings.</p>
<pre>
f_open(fp, "filename.txt", FA_READ); <span class="c">/* ANSI/OEM string */</span>
f_open(fp, L"filename.txt", FA_READ); <span class="c">/* Unicode string */</span>
@@ -64,13 +64,13 @@ PARTITION VolToPart[] = {
{0, 3}, <span class="c">/* Logical drive 2 ==> Physical drive 0, 3rd partition */</span>
{1, 0} <span class="c">/* Logical drive 3 ==> Physical drive 1 (auto detection) */</span>
};
-
-<img src="../img/f7.png" width="828" height="288" alt="relationship between logical drive and physical drive">
</pre>
+<div><img src="../img/f7.png" width="828" height="288" alt="relationship between logical drive and physical drive"></div>
<p>There are some considerations on using <tt>_MULTI_PARTITION</tt> configuration.</p>
<ul>
-<li>Only four primary partitions can be specified. Logical partition is not supported.</li>
<li>The physical drive that has two or more mounted partitions must be non-removable. Media change while a system operation is prohibited.</li>
+<li>Only four primary partitions can be specified. Extended partition is not supported.</li>
+<li>Windows does not support multiple volumes on the removable storage. Only first parition will be mounted.</li>
</ul>
</div>
diff --git a/fatfs/doc/en/getcwd.html b/fatfs/doc/en/getcwd.html
index df84287..045cce4 100644
--- a/fatfs/doc/en/getcwd.html
+++ b/fatfs/doc/en/getcwd.html
@@ -28,7 +28,7 @@ FRESULT f_getcwd (
<dt>buff</dt>
<dd>Pointer to the buffer to receive the current directory string.</dd>
<dt>len</dt>
-<dd>Size of the buffer in unit of TCHAR.</dd>
+<dd>Size of the buffer in unit of <tt>TCHAR</tt>.</dd>
</dl>
</div>
diff --git a/fatfs/doc/en/mkfs.html b/fatfs/doc/en/mkfs.html
index 573bdd7..5f733fa 100644
--- a/fatfs/doc/en/mkfs.html
+++ b/fatfs/doc/en/mkfs.html
@@ -31,7 +31,7 @@ FRESULT f_mkfs (
<dt>sfd</dt>
<dd>Specifies partitioning rule (FDISK(0) or SFD(1)). This argument will be ignored on some case.</dd>
<dt>au</dt>
-<dd>Specifies size of the allocation unit (cluter) in unit of byte. The value must be sector size * n (n is 1 to 128 and power of 2). When a zero is given, the cluster size is determined depends on the volume size.</dd>
+<dd>Specifies size of the allocation unit (cluter) in number of bytes or sectors. When the value is from 1 to 128, it specifies number of sectors. When the value is <tt>&gt;= _MIN_SS</tt>, it specifies number of bytes. If any invalid value, zero or not power of 2, is given, the cluster size is automatically determined depends on the volume size.</dd>
</dl>
</div>
@@ -51,11 +51,11 @@ FRESULT f_mkfs (
<div class="para desc">
<h4>Description</h4>
-<p>The <tt>f_mkfs()</tt> function creates an FAT volume on the logical drive. When FDISK format is specified, a primary partition occupies the entire disk space is created and then an FAT volume is created on the partition. When SFD format is specified, the FAT volume starts from the first sector of the physical drive.</p>
-<p>If the logical drive has been bound to any partition (1-4) by multiple partition feature (<tt>_MULTI_PARTITION</tt>), the FAT volume is created into the specified partition. In this case, the second argument <tt class="arg">sfd</tt> is ignored. The physical drive must have been partitioned with <tt>f_fdisk()</tt> function or any other partitioning tool prior to use this function.</p>
-<p>Note that there are two partitioning rules, FDISK and SFD. The FDISK partitioning is usually used for harddisk, MMC, SDC, CFC and U Disk. It can divide a physical drive into one or more partitions with a partition table on the MBR. However Windows does not support multiple partition on the removable media. The SFD is non-partitioned method. The FAT volume starts from the first sector on the physical drive without partition table. It is usually used for floppy disk, Microdrive, optical disk and super-floppy media.</p>
-<p>The FAT sub-type, FAT12/FAT16/FAT32, is determined by number of clusters on the volume and nothing else, according to the FAT specification issued by Microsoft. Thus which FAT sub-type is selected, is depends on the volume size and the specified cluster size. The cluster size affects performance of the file system and large cluster increases the performance.</p>
-<p>When the number of clusters gets near the FAT sub-type boundaries, the function can fail with <tt>FR_MKFS_ABORTED</tt>.</p>
+<p>The <tt>f_mkfs()</tt> function creates an FAT volume on the specified logical drive. When FDISK format is specified, a primary partition occupies entire space of the physical drive is created and then an FAT volume is created on the partition. When SFD format is specified, the FAT volume starts from the first sector of the physical drive.</p>
+<p>If the logical drive is bound to the specific partition (1-4) by multiple partition feature (<tt>_MULTI_PARTITION</tt>), the FAT volume is created into the partition. In this case, the second argument <tt class="arg">sfd</tt> is ignored. The physical drive must have been partitioned with <tt>f_fdisk()</tt> function or any other partitioning tools prior to create the FAT volume with this function.</p>
+<p>Note that there are two partitioning rules, FDISK and SFD. The FDISK partitioning is usually used for harddisk, MMC, SDC, CFC and U Disk. It can divide a physical drive into one or more partitions with a partition table on the MBR. However Windows does not support multiple partition on the removable disk. The SFD is non-partitioned method. The FAT volume starts from the first sector on the physical drive without partition table. It is usually used for floppy disk, Microdrive, optical disk and any type of super-floppy media.</p>
+<p>The FAT sub-type, FAT12/FAT16/FAT32, is determined by number of clusters on the volume and nothing else, according to the FAT specification issued by Microsoft. Thus which FAT sub-type is selected, is depends on the volume size and the specified cluster size. The cluster size affects read/write throughput and space usage efficiency. Larger cluster size increases the read/write throughput and decreases the space usage efficiency of the volume.</p>
+<p>In case of the number of clusters gets near the FAT sub-type boundaries, the function can fail with <tt>FR_MKFS_ABORTED</tt>.</p>
</div>
<div class="para comp">
@@ -63,6 +63,42 @@ FRESULT f_mkfs (
<p>Available when <tt>_FS_READOLNY == 0</tt> and <tt>_USE_MKFS == 1</tt>.</p>
</div>
+<div class="para use">
+<h4>Example</h4>
+<pre>
+<span class="c">/* Format the default drive */</span>
+int main (void)
+{
+ FATFS fs; <span class="c">/* File system object (volume work area) */</span>
+ FIL fil; <span class="c">/* File object */</span>
+ FRESULT res; <span class="c">/* API result code */</span>
+ UINT bw; <span class="c">/* Bytes written */</span>
+
+
+ <span class="c">/* Register work area */</span>
+ f_mount(&amp;fs, "", 0);
+
+ <span class="c">/* Create FAT volume with default cluster size */</span>
+ res = f_mkfs("", 0, 0);
+ if (res) ...
+
+ <span class="c">/* Create a file as new */</span>
+ res = f_open(&fil, "hello.txt", FA_CREATE_NEW | FA_WRITE);
+ if (res) ...
+
+ <span class="c">/* Write a message */</span>
+ f_write(&fil, "Hello, World!\r\n", 15, &bw);
+ if (bw != 15) ...
+
+ <span class="c">/* Close the file */</span>
+ f_close(&fil);
+
+ <span class="c">/* Unregister work area */</span>
+ f_mount(0, "", 0);
+
+</pre>
+</div>
+
<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="filename.html#vol">Volume management</a>, <a href="fdisk.html">f_fdisk</a></tt></p>
diff --git a/fatfs/doc/en/mount.html b/fatfs/doc/en/mount.html
index c4a00fc..0edb73a 100644
--- a/fatfs/doc/en/mount.html
+++ b/fatfs/doc/en/mount.html
@@ -62,7 +62,7 @@ FRESULT f_mount (
<li>File system object is not initialized. It is cleared by <tt>f_mount()</tt>.</li>
<li>Physical drive is not initialized. It is de-initialized by system reset or media removal.</li>
</ul>
-<p>If the function with forced mount failed, it means that the file system object is registered but the volume is currently not available. Mount process will also be attempted in subsequent file access functions.</p>
+<p>If the function with forced mount failed, it means that the file system object has been registered successfully but the volume is currently not ready to use. Mount process will also be attempted in subsequent file access functions.</p>
<p>If implementation of the disk I/O layer lacks media change detection, application program needs to perform a <tt>f_mount()</tt> after each media change to force cleared the file system object.</p>
</div>
diff --git a/fatfs/doc/en/rc.html b/fatfs/doc/en/rc.html
index c93479e..306671a 100644
--- a/fatfs/doc/en/rc.html
+++ b/fatfs/doc/en/rc.html
@@ -21,7 +21,7 @@
<dt id="ie">FR_INT_ERR</dt>
<dd>Assertion failed. An insanity is detected in the internal process. One of the following possibilities is suspected.
<ul>
-<li>Work area (file system object, file object or etc...) is broken by stack overflow or any other application. This is the reason in most case.</li>
+<li>Work area (file system object, file object or etc...) has been broken by stack overflow or any other tasks. This is the reason in most case.</li>
<li>There is any error of the FAT structure on the volume.</li>
</ul>
Note that if once this error occured at any operation to an open file, the file object is aborted and all operations to the file except for close will be rejected.
@@ -51,7 +51,7 @@ Note that if once this error occured at any operation to an open file, the file
<dt id="io">FR_INVALID_OBJECT</dt>
<dd>The file/directory object structure is invalid or a null pointer is given. All open objects of the logical drive are invalidated by the voulme mount process.</dd>
<dt id="wp">FR_WRITE_PROTECTED</dt>
-<dd>Any write mode action against the write-protected media.</dd>
+<dd>Any write mode operation against the write-protected media.</dd>
<dt id="id">FR_INVALID_DRIVE</dt>
<dd>Invalid drive number is specified in the path name. A null pointer is given as the path name. (Related option: <tt>_VOLUMES</tt>)</dd>
<dt id="ne">FR_NOT_ENABLED</dt>
@@ -74,7 +74,7 @@ Note that if once this error occured at any operation to an open file, the file
<dd>Not enough memory for the operation. There is one of the following reasons:
<ul>
<li>Could not allocate a memory for LFN working buffer. (Related option: <tt>_USE_LFN</tt>)</li>
-<li>Size of the given CLMT buffer is insufficient for the file fragments.</li>
+<li>Size of the given buffer is insufficient for the size required.</li>
</ul>
</dd>
<dt id="tf">FR_TOO_MANY_OPEN_FILES</dt>
diff --git a/fatfs/doc/en/readdir.html b/fatfs/doc/en/readdir.html
index 9808435..bf83ebe 100644
--- a/fatfs/doc/en/readdir.html
+++ b/fatfs/doc/en/readdir.html
@@ -77,7 +77,7 @@ FRESULT scan_files (
FILINFO fno;
DIR dir;
int i;
- char *fn; <span class="c">/* This function is assuming non-Unicode cfg. */</span>
+ char *fn; <span class="c">/* This function assumes non-Unicode configuration */</span>
<span class="k">#if</span> _USE_LFN
static char lfn[_MAX_LFN + 1]; <span class="c">/* Buffer to store the LFN */</span>
fno.lfname = lfn;
@@ -100,8 +100,8 @@ FRESULT scan_files (
if (fno.fattrib &amp; AM_DIR) { <span class="c">/* It is a directory */</span>
sprintf(&amp;path[i], "/%s", fn);
res = scan_files(path);
- if (res != FR_OK) break;
path[i] = 0;
+ if (res != FR_OK) break;
} else { <span class="c">/* It is a file. */</span>
printf("%s/%s\n", path, fn);
}
diff --git a/fatfs/doc/en/sfile.html b/fatfs/doc/en/sfile.html
index e6edf70..1ed9899 100644
--- a/fatfs/doc/en/sfile.html
+++ b/fatfs/doc/en/sfile.html
@@ -13,7 +13,7 @@
<div class="para">
<h2>FIL</h2>
-<p>The <tt>FIL</tt> structure (file object) holds state of an open file. It is created by <tt>f_open()</tt> function and discarded by <tt>f_close()</tt> function. Application program must not modify any member in this structure except for <tt>cltbl</tt>. Note that a sector buffer is defined in this structure at non-tiny configuration, so that the <tt>FIL</tt> structures should not be defined as auto variable.</p>
+<p>The <tt>FIL</tt> structure (file object) holds the state of an open file. It is created by <tt>f_open()</tt> function and discarded by <tt>f_close()</tt> function. Application program must not modify any member in this structure except for <tt>cltbl</tt>. Note that a sector buffer is defined in this structure at non-tiny configuration (<tt>_FS_TINY == 0</tt>), so that the <tt>FIL</tt> structures at that configuration should not be defined as auto variable.</p>
<pre>
<span class="k">typedef</span> <span class="k">struct</span> {
diff --git a/fatfs/doc/en/sfileinfo.html b/fatfs/doc/en/sfileinfo.html
index 5674086..ac254a1 100644
--- a/fatfs/doc/en/sfileinfo.html
+++ b/fatfs/doc/en/sfileinfo.html
@@ -60,9 +60,9 @@
<dt>fname[]</dt>
<dd>Indicates the file/directory name in 8.3 format null-terminated string. It is always returnd with upper case in non-LFN configuration but it can be returned with lower case in LFN configuration.</dd>
<dt>lfname</dt>
-<dd>Pointer to the LFN buffer to store the read LFN. This member must be initialized by application prior to use this structure. Set null pointer if LFN is not needed. Not available in non-LFN configuration.</dd>
+<dd>Pointer to the LFN buffer to store the read LFN. This member must be initialized by application program prior to use this structure. Set a null pointer if LFN is not needed. Not available at non-LFN configuration.</dd>
<dt>lfsize</dt>
-<dd>Size of the LFN buffer in unit of TCHAR. This member must be initialized by application prior to use this structure. Not available in non-LFN configuration.</dd>
+<dd>Size of the LFN buffer in unit of TCHAR. This member must be initialized by application program prior to use this structure. Not available at non-LFN configuration.</dd>
</dl>
<p class="foot"><a href="../00index_e.html">Return</a></p>
diff --git a/fatfs/doc/en/stat.html b/fatfs/doc/en/stat.html
index 8ea343b..db53c5d 100644
--- a/fatfs/doc/en/stat.html
+++ b/fatfs/doc/en/stat.html
@@ -55,6 +55,7 @@ FRESULT f_stat (
<div class="para desc">
<h4>Description</h4>
<p>The <tt>f_stat()</tt> function checks the existence of a file or sub-directory. If not exist, the function returns with <tt>FR_NO_FILE</tt>. If exist, the function returns with <tt>FR_OK</tt> and the informations of the object, file size, timestamp, attribute and SFN, are stored to the file information structure. For details of the file information, refer to the <tt>FILINFO</tt> structure and <a href="readdir.html"><tt>f_readdir()</tt></a> function.</p>
+<p>When LFN feature is enabled, <tt>lfname</tt> in the file information structure must be NULLed prior to use it.</p>
</div>
@@ -64,6 +65,45 @@ FRESULT f_stat (
</div>
+<div class="para use">
+<h4>Example</h4>
+<pre>
+ FRESULT fr;
+ FILINFO fno;
+
+
+ printf("Test for 'file.txt'...\n");
+
+<span class="k">#if</span> _USE_LFN
+ fno.lfname = 0;
+<span class="k">#endif</span>
+ fr = f_stat("file.txt", &amp;fno);
+ switch (fr) {
+
+ case FR_OK:
+ printf("Size: %u\n", fno.fsize);
+ printf("Timestamp: %u/%02u/%02u, %02u:%02u\n",
+ (fno.fdate &gt;&gt; 9) + 1980, fno.fdate &gt;&gt; 5 &amp; 15, fno.fdate &amp; 31,
+ fno.ftime &gt;&gt; 11, fno.ftime &gt;&gt; 5 &amp; 63);
+ printf("Attributes: %c%c%c%c%c\n",
+ (fno.fattrib & AM_DIR) ? 'D' : '-',
+ (fno.fattrib & AM_RDO) ? 'R' : '-',
+ (fno.fattrib & AM_HID) ? 'H' : '-',
+ (fno.fattrib & AM_SYS) ? 'S' : '-',
+ (fno.fattrib & AM_ARC) ? 'A' : '-');
+ break;
+
+ case FR_NO_FILE:
+ printf("It is not exist.\n");
+ break;
+
+ default:
+ printf("An error occured. (%d)\n", fr);
+ }
+</pre>
+</div>
+
+
<div class="para ref">
<h4>References</h4>
<p><tt><a href="opendir.html">f_opendir</a>, <a href="readdir.html">f_readdir</a>, <a href="sfileinfo.html">FILINFO</a></tt></p>
diff --git a/fatfs/doc/img/app3.c b/fatfs/doc/img/app3.c
index 736c15a..662c403 100644
--- a/fatfs/doc/img/app3.c
+++ b/fatfs/doc/img/app3.c
@@ -6,7 +6,7 @@
/ If the file has been opened without FA_WRITE flag, it only checks if
/ the file is contiguous and returns the resulut. */
-#if _FATFS != 8051 /* Check if R0.10b */
+#if _FATFS != 80367 /* Check if R0.10c */
#error This function may not be compatible with this revision of FatFs module.
#endif
diff --git a/fatfs/doc/img/mkfatimg.zip b/fatfs/doc/img/mkfatimg.zip
new file mode 100644
index 0000000..d0728b4
--- /dev/null
+++ b/fatfs/doc/img/mkfatimg.zip
Binary files differ
diff --git a/fatfs/doc/ja/appnote.html b/fatfs/doc/ja/appnote.html
index 0fb5579..4985bae 100644
--- a/fatfs/doc/ja/appnote.html
+++ b/fatfs/doc/ja/appnote.html
@@ -6,24 +6,24 @@
<link rel="up" title="FatFs" href="../00index_j.html">
<link rel="alternate" hreflang="en" title="English" href="../en/appnote.html">
<link rel="stylesheet" href="../css_j.css" type="text/css" media="screen" title="ELM Default">
-<title>FatFsモジュール アプリケーション・ノート</title>
+<title>FatFsモジュール アプリケーション ノート</title>
</head>
<body>
-<h1>FatFsモジュール アプリケーション・ノート</h1>
+<h1>FatFsモジュール アプリケーション ノート</h1>
<ol class="toc">
<li><a href="#port">ポーティングの際に配慮すべきこと</a></li>
<li><a href="#limits">限界値</a></li>
<li><a href="#memory">メモリ使用量</a></li>
-<li><a href="#reduce">モジュール・サイズの縮小</a></li>
+<li><a href="#reduce">モジュール サイズの縮小</a></li>
<li><a href="#lfn">長いファイル名</a></li>
<li><a href="#jap">日本語ファイル名の大文字変換</a></li>
<li><a href="#unicode">Unicode入出力への対応</a></li>
<li><a href="#reentrant">リエントランシー</a></li>
-<li><a href="#dup">多重ファイル・アクセス</a></li>
-<li><a href="#fs1">効率的なファイル・アクセス</a></li>
-<li><a href="#fs2">フラッシュ・メモリの特性への配慮</a></li>
-<li><a href="#critical">クリチカル・セクション</a></li>
+<li><a href="#dup">多重ファイル アクセス</a></li>
+<li><a href="#fs1">効率的なファイル アクセス</a></li>
+<li><a href="#fs2">フラッシュ メモリの特性への配慮</a></li>
+<li><a href="#critical">クリチカル セクション</a></li>
<li><a href="#fs3">APIの拡張的使用例</a></li>
<li><a href="#license">FatFsのライセンスについて</a></li>
</ol>
@@ -44,18 +44,18 @@ FatFsモジュールはANSI C(C89)準拠で記述されているので、普通
<h4>システム構成</h4>
<p>下に示す依存関係図は、FatFsモジュール利用の組み込みシステムにおける代表的な構成を示します。</p>
<p><img src="../img/modules.png" width="580" height="280" alt="システム構成図"></p>
-<p>(a) FatFs用に書かれたディスク・モジュールがある場合は、そのまま追加するだけです。 (b) しかし、多くの既存のディスク・モジュールはそのAPIをFatFsに合わせるため、グルー関数が必要になるでしょう。</p>
+<p>(a) FatFs用に書かれたディスク モジュールがある場合は、そのまま追加するだけです。 (b) しかし、多くの既存のディスク モジュールはそのAPIをFatFsに合わせるため、グルー関数が必要になるでしょう。</p>
<p><img src="../img/funcs.png" width="680" height="430" alt="functional diagram"></p>
<h4>ユーザの作成する関数</h4>
-<p>必要なのはFatFsモジュールの要求するディスク関数を用意することだけで、それ以外にすることはありません。既に動作しているディスク・モジュールがあるなら、そのAPIをFatFsに合わせるかグルー関数を介してつなぐだけで済みますが、無い場合はほかから移植するか最初から書くかする必要があります。定義されている全ての関数が常に必要なわけではありません。例えば、リード・オンリー構成では書き込み系関数は必要ありません。次の表に構成オプションと要求される関数の対応を示します。</p>
+<p>必要なのはFatFsモジュールの要求するディスク関数を用意することだけで、それ以外にすることはありません。既に動作しているディスク モジュールがあるなら、そのAPIをFatFsに合わせるかグルー関数を介してつなぐだけで済みますが、無い場合はほかから移植するか最初から書くかする必要があります。定義されている全ての関数が常に必要なわけではありません。例えば、リード オンリー構成では書き込み系関数は必要ありません。次の表に構成オプションと要求される関数の対応を示します。</p>
<table class="lst2">
<tr><th>必要な関数</th><th>必要となる条件</th><th>備考</th></tr>
<tr><td>disk_status<br>disk_initialize<br>disk_read</td><td>常時</td><td rowspan="5">ffsample.zip (サンプル)<br>その他web上に多数</td></tr>
<tr><td>disk_write<br>get_fattime<br>disk_ioctl (CTRL_SYNC)</td><td>_FS_READONLY == 0</td></tr>
<tr><td>disk_ioctl (GET_SECTOR_COUNT)<br>disk_ioctl (GET_BLOCK_SIZE)</td><td>_USE_MKFS == 1</td></tr>
<tr><td>disk_ioctl (GET_SECTOR_SIZE)</td><td>_MAX_SS != _MIN_SS</td></tr>
-<tr><td>disk_ioctl (CTRL_ERASE_SECTOR)</td><td>_USE_ERASE == 1</td></tr>
+<tr><td>disk_ioctl (CTRL_TRIM)</td><td>_USE_TRIM == 1</td></tr>
<tr><td>ff_convert<br>ff_wtoupper</td><td>_USE_LFN &gt;= 1</td><td>option/unicode.c</td></tr>
<tr><td>ff_cre_syncobj<br>ff_rel_grant<br>ff_req_grant<br>ff_del_syncobj</td><td>_FS_REENTRANT == 1</td><td rowspan="2">option/syscall.c (サンプル)</td></tr>
<tr><td>ff_mem_alloc<br>ff_mem_free</td><td>_USE_LFN == 3</td></tr>
@@ -66,18 +66,18 @@ FatFsモジュールはANSI C(C89)準拠で記述されているので、普通
<h3>限界値</h3>
<ul>
<li>FATタイプ: FAT12, FAT16, FAT32。</li>
-<li>同時オープン・ファイル数: 無制限。(利用可能メモリによる)</li>
+<li>同時オープン ファイル数: 無制限。(利用可能メモリによる)</li>
<li>ボリューム数: 最大 10。</li>
-<li>ファイル・サイズ: FAT規格に依存。(最大 4G-1バイト)</li>
-<li>ボリューム・サイズ: FAT規格に依存。(最大 2Tバイト(512バイト/セクタ時))</li>
-<li>クラスタ・サイズ: FAT規格に依存。(最大 64Kバイト(512バイト/セクタ時))</li>
-<li>セクタ・サイズ: FAT規格に依存。(512~4096バイト)</li>
+<li>ファイル サイズ: FAT規格に依存。(最大 4G-1バイト)</li>
+<li>ボリューム サイズ: FAT規格に依存。(最大 2Tバイト(512バイト/セクタ時))</li>
+<li>クラスタ サイズ: FAT規格に依存。(最大 64Kバイト(512バイト/セクタ時))</li>
+<li>セクタ サイズ: FAT規格に依存。(512~4096バイト)</li>
</ul>
</div>
<div class="para" id="memory">
<h3>メモリ使用量</h3>
-<p>次の表にいくつかのターゲットにおけるメモリ使用量の例を示します。テスト時の構成オプションはその下の通りです。数値の単位はバイトで、<em>V</em>はボリューム数、<em>F</em>は同時オープン・ファイル数を示します。コンパイラの最適化オプションはコード・サイズとしています。</p>
+<p>次の表にいくつかのターゲットにおけるメモリ使用量の例を示します。テスト時の構成オプションはその下の通りです。数値の単位はバイトで、<em>V</em>はボリューム数、<em>F</em>は同時オープン ファイル数を示します。コンパイラの最適化オプションはコード サイズとしています。</p>
<table class="lst2">
<tr><th></th><th>ARM7<small><br>32bit</small></th><th>ARM7<small><br>Thumb</small></th><th>CM3<small><br>Thumb-2</small></th><th>AVR</th><th>H8/300H</th><th>PIC24</th><th>RL78</th><th>V850ES</th><th>SH-2A</th><th>RX600</th><th>IA-32</th></tr>
<tr class="cal"> <td>Compiler</td><td>GCC</td><td>GCC</td><td>GCC</td><td>GCC</td><td>CH38</td><td>C30</td><td>CC78K0R</td><td>CA850</td><td>SHC</td><td>RXC</td><td>VC6</td></tr>
@@ -99,7 +99,7 @@ _USE_STRFUNC 0 (Disable string functions)
_USE_MKFS 0 (Disable f_mkfs function)
_USE_FORWARD 0 (Disable f_forward function)
_USE_FASTSEEK 0 (Disable fast seek feature)
-_CODE_PAGE 932 (Japanese Shift-JIS)
+_CODE_PAGE 932 (Japanese Shift_JIS)
_USE_LFN 0 (Disable LFN feature)
_MAX_SS 512 (Fixed sector size)
_FS_RPATH 0 (Disable relative path feature)
@@ -112,7 +112,7 @@ _FS_LOCK 0 (Disable file lock control)
</div>
<div class="para" id="reduce">
-<h3>モジュール・サイズの縮小</h3>
+<h3>モジュール サイズの縮小</h3>
<p>次の表は構成オプションの設定値によりどの機能が削除されるかを示します。</p>
<table class="lst2">
<tr><td rowspan="2">Function</td><td colspan="4">_FS_MINIMIZE</td><td colspan="2">_FS_READONLY</td><td colspan="2">_USE_STRFUNC</td><td colspan="3">_FS_RPATH</td><td colspan="2">_FS_LABEL</td><td colspan="2">_USE_MKFS</td><td colspan="2">_USE_FORWARD</td><td colspan="2">_MULTI_PARTITION</td></tr>
@@ -152,19 +152,19 @@ _FS_LOCK 0 (Disable file lock control)
<div class="para" id="lfn">
<h3>長いファイル名</h3>
-<p>FatFsモジュールは、長いファイル名(LFN)をサポートします。ファイルに付けられた2つの異なる名前(短いファル名と長いファイル名)は、<tt>f_readdir()</tt>を除くファイル操作関数において透過です。デフォルト構成では、LFN機能はOFFになっています。LFN機能を有効にするには、<tt>_USE_LFN</tt>を1,2または3に設定し、<tt>option/unicode.c</tt>をプロジェクトに追加します。LFN機能は、加えてある程度のワーク・エリア(LFN操作バッファ)を必要とします。バッファ長は使用できるメモリに応じて<tt>_MAX_LFN</tt>オプションで構成されることができます。LFNの長さは最大255文字に達するので、LFN完全対応のためには<tt>_MAX_LFN</tt>は255に設定されるべきです。与えられたファイル名に対してバッファ長が不足した場合、ファイル関数は<tt>FR_INVALID_NAME</tt>で失敗します。</p>
-<p>ファイル関数に再入を行う条件の下でLFN機能を使用する場合は、<tt>_USE_LFN</tt>は2または3に設定されなければなりません。この場合、ファイル関数はワーク・エリアを動的に確保(スタックまたはヒープ)します。バッファ・サイズは、<tt>(_MAX_LFN + 1) * 2</tt>バイトになるので、スタック等のサイズはそれを考慮した十分なサイズでなければなりません。</p>
+<p>FatFsモジュールは、長いファイル名(LFN)をサポートします。ファイルに付けられた2つの異なる名前(短いファル名と長いファイル名)は、<tt>f_readdir()</tt>を除くファイル操作関数において透過です。デフォルト構成では、LFN機能はOFFになっています。LFN機能を有効にするには、<tt>_USE_LFN</tt>を1,2または3に設定し、<tt>option/unicode.c</tt>をプロジェクトに追加します。LFN機能は、加えてある程度のワーク エリア(LFN操作バッファ)を必要とします。バッファ長は使用できるメモリに応じて<tt>_MAX_LFN</tt>オプションで構成されることができます。LFNの長さは最大255文字に達するので、LFN完全対応のためには<tt>_MAX_LFN</tt>は255に設定されるべきです。与えられたファイル名に対してバッファ長が不足した場合、ファイル関数は<tt>FR_INVALID_NAME</tt>で失敗します。</p>
+<p>ファイル関数に再入を行う条件の下でLFN機能を使用する場合は、<tt>_USE_LFN</tt>は2または3に設定されなければなりません。この場合、ファイル関数はワーク エリアを動的に確保(スタックまたはヒープ)します。バッファ サイズは、<tt>(_MAX_LFN + 1) * 2</tt>バイトになるので、スタック等のサイズはそれを考慮した十分なサイズでなければなりません。</p>
<table class="lst2 rset">
<caption>LFN cfg on ARM7</caption>
<tr><th>コードページ</th><th>コードサイズ[bytes]</th></tr>
<tr><td>SBCS</td><td>+3721</td></tr>
-<tr><td>932(Shift-JIS)</td><td>+62609</td></tr>
+<tr><td>932(Shift_JIS)</td><td>+62609</td></tr>
<tr><td>936(GBK)</td><td>+177797</td></tr>
<tr><td>949(Korean)</td><td>+139857</td></tr>
<tr><td>950(Big5)</td><td>+111497</td></tr>
</table>
-<p>LFN機能の上手な使い方は、それを使わないということです。実際、組み込み用途ではLFN機能がどうしても必要になるということはほとんど無いはずです。LFNを有効にすると、選択されたコード・ページに応じてモジュール・サイズが増大されます。右の表に各コード・ページにおけるLFNを有効にしたときのモジュール・サイズの違いを示します。特に、CJK地域では数万の文字が使われていますが、不幸なことにそれは巨大なOEM-Unicode相互変換テーブルを要求し、モジュール・サイズは劇的に増大されます。その結果、それらのコード・ページにおいてLFNを有効にしたFatFsモジュールは、AVRを含む殆どの8ビット・マイコンにインプリメントされることができません。</p>
-<p>LFN機能のハードルはそれだけではありません。マイクロソフト社はFATファイル・システムについていくつかの特許を保有しています。いずれもLFN機能の実装に関するもので、その利用に対して$0.25/unitのライセンス料を要求しています。このため、商用製品でLFN機能を利用するときは、最終仕向地によってはライセンスが必要になります。最近のFAT32ドライバの多くはLFN機能を含んでいるため、それらの使用に当たってライセンスが必要になりますが、FatFsではLFN機能を構成オプションで任意にON/OFFできるため、無効にしてライセンス問題を回避することもできます。</p>
+<p>LFN機能の上手な使い方は、それを使わないということです。実際、組み込み用途ではLFN機能がどうしても必要になるということはほとんど無いはずです。LFNを有効にすると、選択されたコード ページに応じてモジュール サイズが増大します。右の表に各コード ページにおけるLFNを有効にしたときのモジュール サイズの違いを示します。特に、CJK地域では数万の文字が使われていますが、不幸なことにそれは巨大なOEM-Unicode相互変換テーブルを要求し、モジュール サイズは劇的に増大します。その結果、それらのコード ページにおいてLFNを有効にしたFatFsモジュールは、多くの8ビット マイコンにインプリメントすることができません。</p>
+<p>LFN機能のハードルはそれだけではありません。マイクロソフト社はFATファイル システムについていくつかの特許を保有しています。いずれもLFN機能の実装に関するもので、その利用に対して$0.25/unitのライセンス料を要求しています。このため、商用製品でLFN機能を利用するときは、最終仕向地によってはライセンスが必要になります。最近のFAT32ドライバの多くはLFN機能を含んでいるため、それらの使用に当たってライセンスが必要になりますが、FatFsではLFN機能を構成オプションで任意にON/OFFできるため、無効にしてライセンス問題を回避することもできます。</p>
</div>
<div class="para" id="jap">
@@ -179,61 +179,61 @@ _FS_LOCK 0 (Disable file lock control)
<div class="para" id="reentrant">
<h3>リエントランシー</h3>
-<p>互いに異なるボリュームに対するファイル操作はリエントラントで、常に同時平行に動作できます。同じボリュームに対してはデフォルトではリエントラントではありませんが、<tt>_FS_REENTRANT</tt>オプションでリエントラント(スレッド・セーフ)にすることはできます。この場合、OS依存の同期オブジェクト操作関数<tt>ff_cre_syncobj(), ff_del_syncobj(), ff_req_grant(), ff_rel_grant()</tt>もまたプロジェクトに追加されなければなりません。サンプル・コードと解説は<tt>option/syncobj.c</tt>にあります。</p>
+<p>互いに異なるボリュームに対するファイル操作はリエントラントで、常に同時平行に動作できます。同じボリュームに対してはデフォルトではリエントラントではありませんが、<tt>_FS_REENTRANT</tt>オプションでリエントラント(スレッド セーフ)にすることはできます。この場合、OS依存の同期オブジェクト操作関数<tt>ff_cre_syncobj(), ff_del_syncobj(), ff_req_grant(), ff_rel_grant()</tt>もまたプロジェクトに追加されなければなりません。サンプル コードと解説は<tt>option/syncobj.c</tt>にあります。</p>
<p>この場合、あるタスクがボリュームを使用中に他のタスクからそのボリュームに対するファイル関数が呼び出されると、そのアクセスは先のタスクがファイル関数を抜けるまでブロックされます。もし、待ち時間が<tt>_TIMEOUT</tt>で指定された期間を越すと、その関数は<tt>FR_TIMEOUT</tt>でアボートします。いくつかのRTOSではタイムアウト機能はサポートされないかも知れません。</p>
-<p>ひとつの例外が<tt>f_mount(), f_mkfs(), f_fdisk()</tt>にあります。これらの関数は同じボリューム(または関連する物理ドライブ)に対してリエントラントではありません。これらの関数を使用するときは、アプリケーション・レベルで排他制御しなければなりません。</p>
+<p>ひとつの例外が<tt>f_mount(), f_mkfs(), f_fdisk()</tt>にあります。これらの関数は同じボリューム(または関連する物理ドライブ)に対してリエントラントではありません。これらの関数を使用するときは、アプリケーション レベルで排他制御しなければなりません。</p>
<p>注: このセクションはFatFsモジュールそれ自体のリエントランシーについて説明しています。その下位のディスクI/Oモジュールのリエントランシーに関しては何の前提もありません。</p>
</div>
<div class="para" id="dup">
-<h3>多重ファイル・アクセス</h3>
-<p>FatFsモジュールではデフォルトでは多重アクセス制御機能をサポートしていません。ファイルに対する多重アクセスは、そのアクセス・モードによって制限されます。一つのファイルに対する多重オープンは、それらが全てリード・モードのときに限って許可されます。書き込みモードを含む多重オープン、また開かれているファイルに対するリネームや削除を行ってはなりません。さもないと、そのボリュームのFAT構造が破壊される可能性があります。</p>
-<p><tt>_FS_LOCK</tt>に1以上の値(値は同時に管理できるファイル数)をセットすることで多重アクセス制御機能が有効になり、ファイル単位のアクセス制御を自動で行うこともできます。この場合、上記のルールを破ったオープン・リネーム・削除を試みると、その関数は<tt>FR_LOCKED</tt>で失敗します。また、<tt>_FS_LOCK</tt>を越える数のファイルやサブ・ディレクトリを同時にオープンしようとすると、<tt>FR_TOO_MANY_OPEN_FILES</tt>で失敗します。</p>
+<h3>多重ファイル アクセス</h3>
+<p>FatFsモジュールではデフォルトでは多重アクセス制御機能をサポートしていません。ファイルに対する多重アクセスは、そのアクセス モードによって制限されます。一つのファイルに対する多重オープンは、それらが全てリード モードのときに限って許可されます。書き込みモードを含む多重オープン、また開かれているファイルに対するリネームや削除を行ってはなりません。さもないと、そのボリュームのFAT構造が破壊される可能性があります。</p>
+<p><tt>_FS_LOCK</tt>に1以上の値(値は同時に管理できるファイル数)をセットすることで多重アクセス制御機能が有効になり、ファイル単位のアクセス制御を自動で行うこともできます。この場合、上記のルールを破ったオープン・リネーム・削除を試みると、その関数は<tt>FR_LOCKED</tt>で失敗します。また、<tt>_FS_LOCK</tt>を越える数のファイルやサブ ディレクトリを同時にオープンしようとすると、<tt>FR_TOO_MANY_OPEN_FILES</tt>で失敗します。</p>
</div>
<div class="para" id="fs1">
-<h3>効率的なファイル・アクセス</h3>
-<p>小規模な組込システムでのファイルの読み書きにおける効率の良いアクセスのため、アプリケーション・プログラマはFatFsモジュールの中でどのような処理が行われているか考慮すべきです。ストレージ上のデータは<tt>f_read()</tt>により次のシーケンスで転送されます。</p>
-<p>図1. セクタ・ミスアラインド・リード (ショート)<br>
+<h3>効率的なファイル アクセス</h3>
+<p>小規模な組込システムでのファイルの読み書きにおける効率の良いアクセスのため、アプリケーション プログラマはFatFsモジュールの中でどのような処理が行われているか考慮すべきです。ストレージ上のデータは<tt>f_read()</tt>により次のシーケンスで転送されます。</p>
+<p>図1. セクタ ミスアラインド リード (ショート)<br>
<img src="../img/f1.png" width="490" height="110" alt="fig.1">
</p>
-<p>図2. セクタ・ミスアラインド・リード (ロング)<br>
+<p>図2. セクタ ミスアラインド リード (ロング)<br>
<img src="../img/f2.png" width="490" height="140" alt="fig.2">
</p>
-<p>図3. セクタ・アラインド・リード<br>
+<p>図3. セクタ アラインド リード<br>
<img src="../img/f3.png" width="490" height="119" alt="fig.3">
</p>
-<p>ファイルI/Oバッファはセクタの一部のデータを読み書きするためのセクタ・バッファを意味します。セクタ・バッファは、それぞれのファイル・オブジェクト内のプライベート・セクタ・バッファまたはファイル・システム・オブジェクト内の共有セクタ・バッファのどちらかです。バッファ構成オプションの<tt>_FS_TINY</tt>は、データ転送にどちらを使うかを決定します。タイニー・バッファ(1)が選択されるとデータ・メモリの消費はそれぞれのファイル・オブジェクトで512バイト減少されます。この場合、FatFsモジュールはファイル・データの転送とFAT/ディレクトリ・アクセスにファイル・システム・オブジェクト内のセクタ・バッファだけを使用します。タイニー・バッファの欠点は、セクタ・バッファにキャッシュされたFATデータがファイル・データの転送により失われ、クラスタ境界の毎にリロードされなければならないことです。でも、悪くない性能と少ないメモリ消費の視点から多くのアプリケーションに適するでしょう。</p>
-<p>図1はセクタの一部のデータがファイルI/Oバッファを経由で転送されることを示します。図2に示される長いデータの転送では、転送データの中間の1セクタまたはそれ以上のセクタにまたがる転送データがアプリケーション・バッファに直接転送されています。図3は転送データ全体がセクタ境界にアライメントされている場合を示しています。この場合、ファイルI/Oバッファは使用されません。直接転送においては最大の範囲のセクタが<tt>disk_read()</tt>で一度に読み込まれますが、クラスタ境界を越えるマルチ・セクタ転送はそれが隣接であっても行われません。</p>
-<p>このように、セクタにアライメントしたファイルの読み書きへの配慮はバッファ経由のデータ転送を避け、読み書き性能は改善されるでしょう。その効果に加え、タイニー構成でキャッシュされたFATデータがファイル・データの転送によりフラッシュされず、非タイニー構成と同じ性能を小さなメモリ・フットプリントで達成できます。</p>
+<p>ファイルI/Oバッファはセクタの一部のデータを読み書きするためのセクタ バッファを意味します。セクタ バッファは、それぞれのファイル オブジェクト内のプライベート セクタ バッファまたはファイル システム オブジェクト内の共有セクタ バッファのどちらかです。バッファ構成オプションの<tt>_FS_TINY</tt>は、データ転送にどちらを使うかを決定します。タイニー バッファ(1)が選択されるとデータ メモリの消費はそれぞれのファイル オブジェクトで<tt>_MAX_SS</tt>バイト減少されます。この場合、FatFsモジュールはファイル データの転送とFAT/ディレクトリ アクセスにファイル システム オブジェクト内のセクタ バッファだけを使用します。タイニー バッファの欠点は、セクタ バッファにキャッシュされたFATデータがファイル データの転送により失われ、クラスタ境界の毎にリロードされなければならないことです。でも、悪くない性能と少ないメモリ消費の視点から多くのアプリケーションに適するでしょう。</p>
+<p>図1はセクタの一部のデータがファイルI/Oバッファを経由で転送されることを示します。図2に示される長いデータの転送では、転送データの中間の1セクタまたはそれ以上のセクタにまたがる転送データがアプリケーション バッファに直接転送されています。図3は転送データ全体がセクタ境界にアライメントされている場合を示しています。この場合、ファイルI/Oバッファは使用されません。直接転送においては最大の範囲のセクタが<tt>disk_read()</tt>で一度に読み込まれますが、クラスタ境界を越えるマルチ セクタ転送はそれが隣接であっても行われません。</p>
+<p>このように、セクタにアライメントしたファイルの読み書きへの配慮はバッファ経由のデータ転送を避け、読み書き性能は改善されるでしょう。その効果に加え、タイニー構成でキャッシュされたFATデータがファイル データの転送によりフラッシュされず、非タイニー構成と同じ性能を小さなメモリ フットプリントで達成できます。</p>
</div>
<div class="para" id="fs2">
-<h3>フラッシュ・メモリの特性への配慮</h3>
-<p>HDDなどのディスク・メディアとは異なり、SDCやCFCなどのフラッシュ・メモリ・メディアの性能を引き出すには、その特性を意識した制御が必要になります。</p>
-<h4>マルチ・セクタ書き込み</h4>
+<h3>フラッシュ メモリの特性への配慮</h3>
+<p>HDDなどのディスク メディアとは異なり、SDCやCFCなどのフラッシュ メモリ メディアの性能を引き出すには、その特性を意識した制御が必要になります。</p>
+<h4>マルチ セクタ書き込み</h4>
<div class="rset">
-図6. マルチ/シングル・セクタ・ライトの比較<br>
+図6. マルチ/シングル セクタ ライトの比較<br>
<img src="../img/f6.png" width="630" height="148" alt="fig.6">
</div>
-<p>フラッシュ・メモリ・メディアの書き込み速度はシングル・セクタ書き込みの時に最も低いものになり、一回のトランザクションで転送されるセクタ数が大きくなるほど書き込み速度は向上します。この効果はバス速度が高速になるほど顕著で、10倍以上の差が現れることも珍しくありません。<a href="../img/rwtest2.png">テスト結果</a>は、マルチ・セクタ書き込み(W:16K, 32 sectors)がシングル・セクタ書き込み(W:100, 1 sector)よりどの程度速いかを明確に示しています。大容量メディアほどシングル・セクタ書き込みが遅くなる点もまた重要です。書き込みトランザクションの回数はまた、メディアの寿命にも影響してきます。このため、アプリケーションはなるべく大きなブロック(クラスタ・サイズまたは2の累乗セクタ境界にアライメントした)で読み書きを行う必要があります。もちろん、アプリケーションからメディアに至る全てのレイヤがマルチ・セクタ転送に対応していないと意味がありません。残念ながら、既存のオープン・ソースのドライバの多くはマルチ・セクタ転送に未対応です。なお、FatFsモジュールおよびサンプル・ドライバはマルチ・セクタ転送に対応しています。</p>
+<p>フラッシュ メモリ メディアの書き込み速度はシングル セクタ書き込みの時に最も低いものになり、一回のトランザクションで転送されるセクタ数が大きくなるほど書き込み速度は向上します。この効果はバス速度が高速になるほど顕著で、10倍以上の差が現れることも珍しくありません。<a href="../img/rwtest2.png">テスト結果</a>は、マルチ セクタ書き込み(W:16K, 32 sectors)がシングル セクタ書き込み(W:100, 1 sector)よりどの程度速いかを明確に示しています。大容量メディアほどシングル セクタ書き込みが遅くなる点もまた重要です。書き込みトランザクションの回数はまた、メディアの寿命にも影響してきます。このため、アプリケーションはなるべく大きなブロック(クラスタ サイズまたは2の累乗セクタ境界にアライメントした)で読み書きを行う必要があります。もちろん、アプリケーションからメディアに至る全てのレイヤがマルチ セクタ転送に対応していないと意味がありません。残念ながら、既存のオープン ソースのドライバの多くはマルチ セクタ転送に未対応です。なお、FatFsモジュールおよびサンプル ドライバはマルチ セクタ転送に対応しています。</p>
<h4>明示的なメモリ消去</h4>
-<p>通常のファイル消去では、記録されたデータに対して何らかの制御が行われるわけではなく、単にFAT上に未使用クラスタとして記録されているだけです。このため、ファイルが消去されたあともそれらは有効なメモリ・ブロックとしてフラッシュ・メモリ上に残ります。そこで、ファイルを消去するとき、占有していたデータ・セクタを明示的に消去(つまり未使用ブロックにする)することにより、メディア内の空きブロックを増やすことができます。これにより、次にそのブロックに書き込むときの消去動作が無くなり、書き込み性能が向上する可能性があります。また、ウェアレベリングに使えるブロックが増え、メディアの耐久性も向上するかも知れません。この機能を有効にするには、構成オプションの<tt>_USE_ERASE</tt>に1を設定します。これはフラッシュ・メモリ・メディアの内部動作に期待した制御なので、効果があるとは限りません。また、ファイル消去の時間が延びることも考慮に入れるべきです。</p>
+<p>通常のファイル消去では、記録されたデータに対して何らかの制御が行われるわけではなく、単にFAT上に未使用クラスタとして記録されているだけです。このため、ファイルが消去されたあともそれらは有効なメモリ ブロックとしてフラッシュ メモリ上に残ります。そこで、ファイルを消去するとき、占有していたデータ セクタを明示的に消去(つまり未使用ブロックにする)することにより、メディア内の空きブロックを増やすことができます。これにより、次にそのブロックに書き込むときの消去動作が無くなり、書き込み性能が向上する可能性があります。また、ウェアレベリングに使えるブロックが増え、メディアの耐久性も向上するかも知れません。この機能を有効にするには、構成オプションの<tt>_USE_TRIM</tt>に1を設定します。これはフラッシュ メモリ メディアの内部動作に期待した制御なので、効果があるとは限りません。また、ファイル消去の時間が延びることも考慮に入れるべきです。</p>
</div>
<div class="para" id="critical">
-<h3>クリチカル・セクション</h3>
-<p>ストレージ上のFAT構造を操作している途中で、停電、不正なメディアの取り外し、回復不能なデータ・エラー等の障害が発生すると、処理が中途半端な状態で中断され、その結果としてFATボリュームの構造が破壊される可能性があります。次にFatFsモジュールにおけるクリチカル・セクションと、その間の障害により起きうるエラーの状態を示します。</p>
+<h3>クリチカル セクション</h3>
+<p>ストレージ上のFAT構造を操作している途中で、停電、不正なメディアの取り外し、回復不能なデータ エラー等の障害が発生すると、処理が中途半端な状態で中断され、その結果としてFATボリュームの構造が破壊される可能性があります。次にFatFsモジュールにおけるクリチカル セクションと、その間の障害により起きうるエラーの状態を示します。</p>
<div class="lset">
-図4. 長いクリチカル・セクション<br>
+図4. 長いクリチカル セクション<br>
<img src="../img/f4.png" width="320" height="436" alt="fig.4">
</div>
<div class="lset">
-図5. 最小化したクリチカル・セクション<br>
+図5. 最小化したクリチカル セクション<br>
<img src="../img/f5.png" width="320" height="436" alt="fig.5">
</div>
<br class="clr">
-<p>赤で示したセクションを実行中に障害が発生した場合、クロス・リンクが発生して操作対象のファイル・ディレクトリが失われる可能性があります。黄色で示したセクションを実行中に障害が発生した場合、つぎのうちいずれかまたは複数の結果が生じる可能性があります。</p>
+<p>赤で示したセクションを実行中に障害が発生した場合、クロス リンクが発生して操作対象のファイル ディレクトリが失われる可能性があります。黄色で示したセクションを実行中に障害が発生した場合、つぎのうちいずれかまたは複数の結果が生じる可能性があります。</p>
<ul>
<li>書き換え中のファイルのデータが破壊される。</li>
<li>追記中のファイルがオープン前の状態に戻る。</li>
@@ -241,7 +241,7 @@ _FS_LOCK 0 (Disable file lock control)
<li>新規または上書きで作成されたファイルの長さがゼロになって残る。</li>
<li>ロストチェーンの発生によりボリュームの利用効率が悪化する。</li>
</ul>
-<p>いずれも書き込み中や操作の対象でないファイルには影響はありません。これらのクリチカル・セクションは、ファイルを書き込みモードで開いている時間を最小限にするか、<tt>f_sync()</tt>を適宜使用することで図5のようにリスクを最小化することができます。</p>
+<p>いずれも書き込み中や操作の対象でないファイルには影響はありません。これらのクリチカル セクションは、ファイルを書き込みモードで開いている時間を最小限にするか、<tt>f_sync()</tt>を適宜使用することで図5のようにリスクを最小化することができます。</p>
</div>
<div class="para" id="fs3">
@@ -258,23 +258,23 @@ _FS_LOCK 0 (Disable file lock control)
<div class="para" id="license">
<h3>FatFsのライセンスについて</h3>
-<p>ソース・ファイルのヘッダにライセンス条件が記述されているので、利用の際はそれに従うこと。英語を読めない方のために以下に日本語訳を示しておきます。</p>
+<p>ソース ファイルのヘッダにライセンス条件が記述されているので、利用の際はそれに従うこと。英語を読めない方のために以下に日本語訳を示しておきます。</p>
<pre>/*----------------------------------------------------------------------------/
/ FatFs - FAT file system module R0.10b (C)ChaN, 2014
/-----------------------------------------------------------------------------/
-/ FatFsモジュールは、小規模な組み込みシステム向けの汎用FATファイルシステム・
-/ モジュールです。これはフリー・ソフトウェアとして、教育・研究・開発のために
-/ 以下のライセンス・ポリシーの下で公開されています。
+/ FatFsモジュールは、小規模な組み込みシステム向けの汎用FATファイルシステム
+/ モジュールです。これはフリー ソフトウェアとして、教育・研究・開発のために
+/ 以下のライセンス ポリシーの下で公開されています。
/
/ Copyright (C) 2014, ChaN, all right reserved.
/
-/ * FatFsモジュールはフリー・ソフトウェアであり、また<em>無保証です</em>。
+/ * FatFsモジュールはフリー ソフトウェアであり、また<em>無保証です</em>。
/ * 用途に制限はありません。<em>あなたの責任の下において</em>、個人的・非営利的な
/ ものから商用製品の開発に及ぶ目的に使用・改変・再配布することができます。
-/ * ソース・コードを再配布するときは、上記の著作権表示を保持しなければなりません。
+/ * ソース コードを再配布するときは、上記の著作権表示を保持しなければなりません。
/
/-----------------------------------------------------------------------------/</pre>
-<p>要するにFatFsはタダで自由に使えるということです。ソース・コードを再配布するときは、このブロックをそのまま保持しておくこと。このようにFatFsはBSDライクなライセンスとしていますが、一つ大きな違いがあります。特に組み込み用途での利用価値を高めるため、バイナリ形式(ソース・コードを含まない形式全て)での再配布については、条件は設けていません。その場合は、FatFsおよびそのライセンス文書についてはドキュメントに明記してもしなくてもかまいません。これは、一条項BSDライセンスと等価ということです。もちろんGNU GPLプロジェクトとも共存可能です。何らかの変更を加えて再配布する際は、矛盾しない他のライセンス(GNU GPLや修正BSDライセンスなど)に変更することも可能です。</p>
+<p>要するにFatFsはタダで自由に使えるということです。ソース コードを再配布するときは、このブロックをそのまま保持しておくこと。このようにFatFsはBSDライクなライセンスとしていますが、一つ大きな違いがあります。特に組み込み用途での利用価値を高めるため、バイナリ形式(ソース コードを含まない形式全て)での再配布については、条件は設けていません。その場合は、FatFsおよびそのライセンス文書についてはドキュメントに明記してもしなくてもかまいません。これは、一条項BSDライセンスと等価ということです。もちろんGNU GPLプロジェクトとも共存可能です。何らかの変更を加えて再配布する際は、矛盾しない他のライセンス(GNU GPLや修正BSDライセンスなど)に変更することも可能です。</p>
</div>
<p class="foot"><a href="../00index_j.html">戻る</a></p>
diff --git a/fatfs/doc/ja/chdir.html b/fatfs/doc/ja/chdir.html
index 4a68fe2..3b09207 100644
--- a/fatfs/doc/ja/chdir.html
+++ b/fatfs/doc/ja/chdir.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/chdir.html">
@@ -13,25 +13,25 @@
<div class="para func">
<h2>f_chdir</h2>
-<p>JgEfBNgύX܂B</p>
+<p>カレント ディレクトリを変更します。</p>
<pre>
FRESULT f_chdir (
- const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] fBNgւ̃|C^ */</span>
+ const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] ディレクトリ名へのポインタ */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>path</dt>
-<dd>ړΏۂ̃fBNg<a href="filename.html">pX</a>k<tt>'\0'</tt>I[̕w肵܂B</dd>
+<dd>移動対象のディレクトリの<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列を指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -49,33 +49,33 @@ FRESULT f_chdir (
<div class="para desc">
-<h4></h4>
-<p>e{[̃JgEfBNgύX܂BJgEfBNǵÃ{[̃}Eg삪sꂽƂA[gEfBNgɏݒ肳܂BJgEfBNǵAt@CEVXeEIuWFNgɕێ邽߁Ã{[gpSẴ^XNɑ΂ĉe^܂B</p>
+<h4>解説</h4>
+<p>各ボリュームのカレント ディレクトリを変更します。カレント ディレクトリは、そのボリュームのマウント動作が行われたとき、ルート ディレクトリに初期設定されます。カレント ディレクトリは、ファイル システム オブジェクトに保持されるため、そのボリュームを使用する全てのタスクに対して影響を与えます。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_RPATH == 1</tt>̂ƂɎgp”\ƂȂ܂B</p>
+<h4>対応情報</h4>
+<p><tt>_FS_RPATH == 1</tt>のときに使用可能となります。</p>
</div>
<div class="para exa">
-<h4>gp</h4>
+<h4>使用例</h4>
<pre>
- <span class="c">/* JgEhCũJgEfBNgύX ([gdir1) */</span>
+ <span class="c">/* カレント ドライブのカレント ディレクトリを変更 (ルート下のdir1へ) */</span>
f_chdir("/dir1");
- <span class="c">/* hCu2̃JgEfBNgύX (efBNg) */</span>
+ <span class="c">/* ドライブ2のカレント ディレクトリを変更 (親ディレクトリへ) */</span>
f_chdir("2:..");
</pre>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="chdrive.html">f_chdrive</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/chdrive.html b/fatfs/doc/ja/chdrive.html
index 305b0a7..7571d4e 100644
--- a/fatfs/doc/ja/chdrive.html
+++ b/fatfs/doc/ja/chdrive.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/chdrive.html">
@@ -13,25 +13,25 @@
<div class="para func">
<h2>f_chdrive</h2>
-<p>JgEhCuύX܂B</p>
+<p>カレント ドライブを変更します。</p>
<pre>
FRESULT f_chdrive (
- const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] ΏۃhCuw肵܂ */</span>
+ const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] 対象ドライブを指定します */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>path</dt>
-<dd>JgEhCuɐݒ肷<a href="filename.html">_hCuԍ</a>w肷pXw肵܂B</dd>
+<dd>カレント ドライブに設定する<a href="filename.html">論理ドライブ番号</a>を指定するパス名を指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#id">FR_INVALID_DRIVE</a>
@@ -40,19 +40,19 @@ FRESULT f_chdrive (
<div class="para desc">
-<h4></h4>
-<p>JgEhCuύX܂BVXeN̏l̓hCu0łB̐ݒFatFsW[̐ÓIϐɋL^邽߁ASẴ^XNɑ΂ĉe^܂B</p>
+<h4>解説</h4>
+<p>カレント ドライブを変更します。システム起動時の初期値はドライブ0です。この設定はFatFsモジュールの静的変数に記録されるため、全てのタスクに対して影響を与えます。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_RPATH == 1</tt>ŁA<tt>_VOLUMES &gt; 1</tt>̂ƂɎgp”\ƂȂ܂B</p>
+<h4>対応情報</h4>
+<p><tt>_FS_RPATH == 1</tt>で、且つ<tt>_VOLUMES &gt; 1</tt>のときに使用可能となります。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="chdir.html">f_chdir</a></tt></p>
</div>
diff --git a/fatfs/doc/ja/chmod.html b/fatfs/doc/ja/chmod.html
index e0d113e..cb8f2b3 100644
--- a/fatfs/doc/ja/chmod.html
+++ b/fatfs/doc/ja/chmod.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/chmod.html">
@@ -13,39 +13,39 @@
<div class="para func">
<h2>f_chmod</h2>
-<p>t@C܂̓TuEfBNg̑ύX܂B</p>
+<p>ファイルまたはサブ ディレクトリの属性を変更します。</p>
<pre>
FRESULT f_chmod (
- const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] IuWFNgւ̃|C^ */</span>
- BYTE <span class="arg">attr</span>, <span class="c">/* [IN] ݒl */</span>
- BYTE <span class="arg">mask</span> <span class="c">/* [IN] ύX}XN */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] オブジェクト名へのポインタ */</span>
+ BYTE <span class="arg">attr</span>, <span class="c">/* [IN] 設定値 */</span>
+ BYTE <span class="arg">mask</span> <span class="c">/* [IN] 変更マスク */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>path</dt>
-<dd>ύXΏۂ̃IuWFNg<a href="filename.html">pX</a>k<tt>'\0'</tt>I[̕w肵܂B</dd>
+<dd>属性変更対象のオブジェクトの<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列を指定します。</dd>
<dt>attr</dt>
-<dd>ݒ肷鑮Bw”\ȑ͎̒ʂŁȂgݍ킹Ŏw肵܂Bw肳Ȃ͉܂B<br>
+<dd>設定する属性。指定可能な属性は次の通りで、これらの組み合わせで指定します。指定されなかった属性は解除されます。<br>
<table class="lst">
-<tr><th>l</th><th>Ӗ</th></tr>
-<tr><td>AM_RDO</td><td>[hEI[</td></tr>
-<tr><td>AM_ARC</td><td>A[JCu</td></tr>
-<tr><td>AM_SYS</td><td>VXe</td></tr>
-<tr><td>AM_HID</td><td>qhD</td></tr>
+<tr><th>値</th><th>意味</th></tr>
+<tr><td>AM_RDO</td><td>リード オンリー</td></tr>
+<tr><td>AM_ARC</td><td>アーカイブ</td></tr>
+<tr><td>AM_SYS</td><td>システム</td></tr>
+<tr><td>AM_HID</td><td>ヒドゥン</td></tr>
</table>
</dd>
<dt>mask</dt>
-<dd>ύX鑮̃}XNBw肵ݒ܂͉Aw肳Ȃ͏Ԃێ܂B<tt class="arg">attr</tt>Ɠlg܂B</dd>
+<dd>変更する属性のマスク。指定した属性が設定または解除され、指定されなかった属性は状態が保持されます。<tt class="arg">attr</tt>と同じ値を使います。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -65,19 +65,19 @@ FRESULT f_chmod (
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_READONLY == 0</tt>ŁA<tt>_FS_MINIMIZE == 0</tt>̂Ƃgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_FS_MINIMIZE == 0</tt>のとき使用可能です。</p>
</div>
<div class="para use">
-<h4>gp</h4>
+<h4>使用例</h4>
<pre>
- <span class="c">/* [hI[ZbgAA[JCuNAȂ͕ύXȂ */</span>
+ <span class="c">/* リードオンリーをセット、アーカイブをクリア、その他は変更しない */</span>
f_chmod("file.txt", AM_RDO, AM_RDO | AM_ARC);
</pre>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/close.html b/fatfs/doc/ja/close.html
index cefd795..71d3c01 100644
--- a/fatfs/doc/ja/close.html
+++ b/fatfs/doc/ja/close.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/close.html">
@@ -13,25 +13,25 @@
<div class="para func">
<h2>f_close</h2>
-<p>t@C‚܂B</p>
+<p>ファイルを閉じます。</p>
<pre>
FRESULT f_close (
- FIL* <span class="arg">fp</span> <span class="c">/* [IN] t@CEIuWFNgւ̃|C^ */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル オブジェクトへのポインタ */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>fp</dt>
-<dd>‚悤Ƃt@C̃t@CEIuWFNg\̂ւ̃|C^w肵܂B</dd>
+<dd>閉じようとするファイルのファイル オブジェクト構造体へのポインタを指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -44,23 +44,23 @@ FRESULT f_close (
<div class="para desc">
-<h4></h4>
-<p>t@C‚܂B炩݂̏̍sꂽt@C̏ꍇALbVꂽ([h/CgEobt@̃f[^AύXꂽFATfBNg)̓fBXNɏ߂܂B֐IƁÃt@CEIuWFNg͖ɂȂÃł܂B</p>
-<p>t@CEIuWFNgǂݏop[hŁA<tt>_FS_LOCK</tt>IvVIĂȂꍇ́At@C‚Ƀt@CEIuWFNgj邱Ƃł܂BA͏̌݊̓_Ő͂܂B</p>
+<h4>解説</h4>
+<p>ファイルを閉じます。何らかの書き込みの行われたファイルの場合、キャッシュされた状態(リード/ライト バッファ上のデータ、変更されたFATやディレクトリ項目)はディスクに書き戻されます。関数が正常終了すると、そのファイル オブジェクトは無効になり、そのメモリも解放できます。</p>
+<p>ファイル オブジェクトが読み出し専用モードで、<tt>_FS_LOCK</tt>オプションが選択されていない場合は、ファイルを閉じずにファイル オブジェクトを破棄することもできます。しかし、これは将来の互換性の点で推奨はされません。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p>SĂ̍\Ŏgp”\łB</p>
+<h4>対応情報</h4>
+<p>全ての構成で使用可能です。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="write.html">f_write</a>, <a href="sync.html">f_sync</a>, <a href="sfile.html">FIL</a>, <a href="sfatfs.html">FATFS</a></tt>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/closedir.html b/fatfs/doc/ja/closedir.html
index 021e8c8..2ccafdb 100644
--- a/fatfs/doc/ja/closedir.html
+++ b/fatfs/doc/ja/closedir.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/close.html">
@@ -13,25 +13,25 @@
<div class="para func">
<h2>f_closedir</h2>
-<p>fBNg‚܂B</p>
+<p>ディレクトリを閉じます。</p>
<pre>
FRESULT f_closedir (
- DIR* <span class="arg">dp</span> <span class="c">/* [IN] fBNgEIuWFNgւ̃|C^ */</span>
+ DIR* <span class="arg">dp</span> <span class="c">/* [IN] ディレクトリ オブジェクトへのポインタ */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>dp</dt>
-<dd>‚悤ƂfBNg̃fBNgEIuWFNg\̂ւ̃|C^w肵܂B</dd>
+<dd>閉じようとするディレクトリのディレクトリ オブジェクト構造体へのポインタを指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#ie">FR_INT_ERR</a>,
@@ -42,23 +42,23 @@ FRESULT f_closedir (
<div class="para desc">
-<h4></h4>
-<p>fBNg‚܂B֐IƁÃfBNgEIuWFNg͖ɂȂÃł܂B</p>
-<p><tt>_FS_LOCK</tt>IvVIĂȂꍇ́Ȁs킸ɃfBNgEIuWFNgj邱Ƃł܂BA͏̌݊̓_Ő͂܂B</p>
+<h4>解説</h4>
+<p>ディレクトリを閉じます。関数が正常終了すると、そのディレクトリ オブジェクトは無効になり、そのメモリも解放できます。</p>
+<p><tt>_FS_LOCK</tt>オプションが選択されていない場合は、この処理を行わずにディレクトリ オブジェクトを破棄することもできます。しかし、これは将来の互換性の点で推奨はされません。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_MINIMIZE &lt;= 1</tt>̂Ƃgp”\ɂȂ܂B</p>
+<h4>対応情報</h4>
+<p><tt>_FS_MINIMIZE &lt;= 1</tt>のとき使用可能になります。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<tt><a href="opendir.html">f_opendir</a>, <a href="readdir.html">f_readdir</a>, <a href="sdir.html">DIR</a></tt>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/dinit.html b/fatfs/doc/ja/dinit.html
index 9168c0b..6329150 100644
--- a/fatfs/doc/ja/dinit.html
+++ b/fatfs/doc/ja/dinit.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/dinit.html">
@@ -13,34 +13,34 @@
<div class="para func">
<h2>disk_initialize</h2>
-<p>Xg[WEfoCX܂B</p>
+<p>ストレージ デバイスを初期化します。</p>
<pre>
DSTATUS disk_initialize (
- BYTE <span class="arg">pdrv</span> <span class="c">/* [IN] hCuԍ */</span>
+ BYTE <span class="arg">pdrv</span> <span class="c">/* [IN] 物理ドライブ番号 */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>pdrv</dt>
-<dd>Ώۂ̃foCXhCuԍ(0-9)w肳܂B</dd>
+<dd>対象のデバイスを識別する物理ドライブ番号(0-9)が指定されます。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
-<p>̊֐͖߂lƂăfBXNEXe[^XԂ܂BfBXNEXe[^X̏ڍׂɊւĂ<tt><a href="dstat.html">disk_status()</a></tt>QƂĂB</p>
+<h4>戻り値</h4>
+<p>この関数は戻り値としてディスク ステータスを返します。ディスク ステータスの詳細に関しては<tt><a href="dstat.html">disk_status()</a></tt>を参照してください。</p>
</div>
<div class="para desc">
-<h4></h4>
-<p>Xg[WEfoCXAf[^̓ǂݏȂǑSĂ̓삪”\ȏԂɂ܂B֐ƁA߂l<tt>STA_NOINIT</tt>tONA܂B</p>
-<p><em>AvP[V͂̊֐ĂяoĂ͂Ȃ܂BȂƁAFAT{[j󂳂”\܂BG[ɂďKvȂƂ́A<tt>f_mount()</tt>gpĂB</em>FatFsW[́A}EgɂAKvɉĂ̊֐Ăяo܂B</p>
+<h4>解説</h4>
+<p>ストレージ デバイスを初期化し、データの読み書きなど全ての動作が可能な状態にします。関数が成功すると、戻り値の<tt>STA_NOINIT</tt>フラグがクリアされます。</p>
+<p><em>アプリケーションからはこの関数を呼び出してはなりません。さもないと、FATボリュームが破壊される可能性があります。エラー等により再初期化が必要なときは、<tt>f_mount()</tt>を使用してください。</em>FatFsモジュールは、自動マウント動作により、必要に応じてこの関数を呼び出します。</p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/dioctl.html b/fatfs/doc/ja/dioctl.html
index 30e49e3..120d798 100644
--- a/fatfs/doc/ja/dioctl.html
+++ b/fatfs/doc/ja/dioctl.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/dioctl.html">
@@ -13,83 +13,83 @@
<div class="para func">
<h2>disk_ioctl</h2>
-<p>ʓIȃf[^ǂݏȊÕXg[WEfoCX̂ɑ΂lXȐs܂B</p>
+<p>一般的なデータ読み書き以外のストレージ デバイス自体に対する様々な制御を行います。</p>
<pre>
DRESULT disk_ioctl (
- BYTE <span class="arg">pdrv</span>, <span class="c">/* [IN] hCuԍ */</span>
- BYTE <span class="arg">cmd</span>, <span class="c">/* [IN] R}h */</span>
- void* <span class="arg">buff</span> <span class="c">/* [I/O] f[^󂯓nobt@ */</span>
+ BYTE <span class="arg">pdrv</span>, <span class="c">/* [IN] 物理ドライブ番号 */</span>
+ BYTE <span class="arg">cmd</span>, <span class="c">/* [IN] 制御コマンド */</span>
+ void* <span class="arg">buff</span> <span class="c">/* [I/O] データ受け渡しバッファ */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>pdrv</dt>
-<dd>Ώۂ̃foCXhCuԍ(0-9)w肳܂B</dd>
+<dd>対象のデバイスを示す物理ドライブ番号(0-9)が指定されます。</dd>
<dt>cmd</dt>
-<dd>R}hER[hw肳܂B</dd>
+<dd>制御コマンド コードが指定されます。</dd>
<dt>buff</dt>
-<dd>R}hɈˑp[^󂷂obt@w|C^w肳܂Bp[^̎̂ȂR}h̏ꍇ́AlɈӖ͂܂B</dd>
+<dd>制御コマンドに依存したパラメータを授受するバッファを指すポインタが指定されます。パラメータの授受のないコマンドの場合は、値に意味はありません。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<dl class="ret">
<dt>RES_OK (0)</dt>
-<dd>IB</dd>
+<dd>正常終了。</dd>
<dt>RES_ERROR</dt>
-<dd>炩̃G[B</dd>
+<dd>何らかのエラーが発生した。</dd>
<dt>RES_PARERR</dt>
-<dd>R}hsB</dd>
+<dd>コマンドが不正。</dd>
<dt>RES_NOTRDY</dt>
-<dd>hCu”\Ԃł͂ȂA܂͏ĂȂB</dd>
+<dd>ドライブが動作可能状態ではない、または初期化されていない。</dd>
</dl>
</div>
<div class="para desc">
-<h4></h4>
-<p>Xg[WEfoCX̎ނɂT|[gR}h͈قȂ܂AFatFsW[̂́A̔ėpR}ĥݎgpÃfoCXɈˑ͍s܂B</p>
+<h4>解説</h4>
+<p>ストレージ デバイスの種類によりサポートされるコマンドは異なりますが、FatFsモジュール自体は、次の汎用コマンドのみ使用し、特定のデバイスに依存した制御は行いません。</p>
<table class="lst">
-<caption>WioctlR}h</caption>
-<tr><th>R}h</th><th></th></tr>
-<tr><td>CTRL_SYNC</td><td>Xg[WEfoCX̃f[^ݏ܂BCgEobNELbVȂǂ݂ꍇ́A܂ĂȂf[^𑦎݂܂BfBAւ݂̏ꂼ<tt>disk_write()</tt>̓Ŋꍇ́ÃR}hɑ΂Ă邱Ƃ͂܂B</td></tr>
-<tr><td>GET_SECTOR_COUNT</td><td><tt class="arg">buff</tt>̎w<tt>DWORD</tt>^ϐɃhCȗZN^Ԃ܂B<tt>f_mkfs()</tt><tt>f_fdisk()</tt>ĂяoA쐬{[̃TCY肷邽߂Ɏgp܂B</td></tr>
-<tr><td>GET_SECTOR_SIZE</td><td><tt class="arg">buff</tt>̎w<tt>WORD</tt>^ϐɃhCũZN^ETCYԂ܂BLl512A1024A2048܂4096łBZN^ETCYŒ\(<tt>_MAX_SS ==_MIN_SS</tt>)̂Ƃ͂̃R}h͎g邱Ƃ͂ȂAɂ̃ZN^ETCYœ삵Ȃ΂Ȃ܂B</td></tr>
-<tr><td>GET_BLOCK_SIZE</td><td><tt class="arg">buff</tt>̎w<tt>DWORD</tt>^ϐɃtbVȄubNETCY(ZN^P)Ԃ܂B132768͈̔͂2̗ݏ̒lłȂ΂Ȃ܂Bsȏꍇ܂̓tbVEȊÕfBAł1Ԃ܂B<tt>f_mkfs()</tt>ł̂ݎgpA{[̃f[^̈͂̋EɃACg܂B</td></tr>
-<tr><td>CTRL_ERASE_SECTOR</td><td>tbVË̗̖IB<tt class="arg">buff</tt>̎w<tt>DWORD</tt>^zɂ͏̈ {JnZN^,IZN^} w肵ČĂяo܂B<tt>_USE_ERASE</tt>1̂ƂANX^ƂɌĂяo܂B́AATAR}hEZbgTrimR}hƓŁA̋@\T|[gȂꍇ͉Kv͂܂B܂A߂l̓`FbNꂸASɍsȂƂĂFatFs̓ɂ͉e܂B</td></tr>
+<caption>標準ioctlコマンド</caption>
+<tr><th>コマンド</th><th>解説</th></tr>
+<tr><td>CTRL_SYNC</td><td>デバイスのデータ書き込み処理を完了させます。ドライバがライト バック キャッシュなどを持っている場合は、書き込まれていないデータを即時書き込みます。メディア上への書き込みがそれぞれ<tt>disk_write()</tt>の中で完了する場合は、このコマンドに対してすることはありません。</td></tr>
+<tr><td>GET_SECTOR_COUNT</td><td>総セクタ数の取得。<tt class="arg">buff</tt>の指す<tt>DWORD</tt>型変数にドライブ上の総セクタ数を返します。<tt>f_mkfs()</tt>および<tt>f_fdisk()</tt>内から呼び出され、作成するボリュームのサイズを決定するために使用されます。</td></tr>
+<tr><td>GET_SECTOR_SIZE</td><td>セクタ サイズの取得。<tt class="arg">buff</tt>の指す<tt>WORD</tt>型変数にドライブのセクタ サイズを返します。有効値は512、1024、2048または4096です。セクタ サイズが固定(<tt>_MAX_SS ==_MIN_SS</tt>)のときはこのコマンドは使われることはなく、デバイスは常にそのセクタ サイズで動作しなければなりません。</td></tr>
+<tr><td>GET_BLOCK_SIZE</td><td>消去ブロック サイズの取得。<tt class="arg">buff</tt>の指す<tt>DWORD</tt>型変数にフラッシュ メモリの消去ブロック サイズ(セクタ単位)を返します。1から32768の範囲で2の累乗の値でなければなりません。ブロック サイズ不明またはフラッシュ メモリ以外のデバイスでは1を返します。<tt>f_mkfs()</tt>内でのみ使用され、作成されるボリュームのデータ領域はこの境界にアライメントされます。</td></tr>
+<tr><td>CTRL_TRIM</td><td>不必要セクタの通知。<tt class="arg">buff</tt>の指す<tt>DWORD</tt>型配列には不必要になった領域 {開始セクタ,終了セクタ} を指定して呼び出されます。TRIM機能が有効(<tt>_USE_TRIM == 1</tt>)で、クラスタが解放されるとき、およびフォーマット時に呼び出されます。これは、ATAコマンド セットのTrimコマンドと等価で、この機能をサポートしないデバイスは何もする必要はありません。また、戻り値はチェックされず、結果によってFatFsの動作が影響を受けることはありません。</td></tr>
</table>
-<p>FatFŝ̓foCXˑR}h⃆[U`R}h͈؎gp܂񂪁AAvP[V牽炩̃foCX䂪sƕ֗ȂƂ܂BAvP[VŕWȊO̐䂪KvȂƂ́AKvɉă[U`R}hljėpƂ悢ł傤BɃR}h̗܂B</p>
+<p>FatFs自体はデバイス依存コマンドやユーザ定義コマンドは一切使用しませんが、アプリケーションから何らかのデバイス制御が行えると便利なことがあります。アプリケーション上で標準以外の制御が必要なときは、必要に応じてユーザ定義コマンドを追加して利用するとよいでしょう。次にコマンドの例を示します。</p>
<table class="lst">
-<caption>[U`ioctlR}h̗</caption>
-<tr><th>R}h</th><th></th></tr>
-<tr><td>CTRL_FORMAT</td><td>fBA̕tH[}bgs܂B<tt class="arg">buff</tt>NULLłȂƂAis\̂߂̃R[obN֐̃AhX܂B</td></tr>
-<tr><td>CTRL_POWER_IDLE</td><td>foCXAChԂɂ܂Bʏ̓ǂݏvŃANeBuԂɖ߂ȂA<tt>STA_NOINIT</tt>tOZbgKv͂܂B</td></tr>
-<tr><td>CTRL_POWER_OFF</td><td>foCXVbg_EԂɂ܂B<tt>STA_NOINIT</tt>̓Zbg܂BfoCX<tt>disk_initialize()</tt>ŃANeBuԂɖ߂܂B</td></tr>
-<tr><td>CTRL_LOCK</td><td>[Uɂ郁fBA̎o֎~܂B</td></tr>
-<tr><td>CTRL_UNLOCK</td><td>[Uɂ郁fBA̎o‚܂B</td></tr>
-<tr><td>CTRL_EJECT</td><td>fBAro܂BA<tt>STA_NOINIT</tt><tt>STA_NODISK</tt>tO̓Zbg܂B</td></tr>
-<tr><td>MMC_GET_TYPE</td><td>J[hE^CvtO(b0:MMCv3, b1:SDv1, b2:SDv2+, b3:LBA)<tt class="arg">buff</tt>̎<tt>BYTE</tt>ϐɓǂݏo܂B(MMC/SDJ[hp)</td></tr>
-<tr><td>MMC_GET_CSD</td><td>CSDWX^̓e<tt class="arg">buff</tt>̎16oCg̃obt@ɓǂݏo܂B(MMC/SDJ[hp)</td></tr>
-<tr><td>MMC_GET_CID</td><td>CIDWX^̓e<tt class="arg">buff</tt>̎16oCg̃obt@ɓǂݏo܂B(MMC/SDJ[hp)</td></tr>
-<tr><td>MMC_GET_OCR</td><td>OCRWX^̓e<tt class="arg">buff</tt>̎4oCg̃obt@ɓǂݏo܂B(MMC/SDJ[hp)</td></tr>
-<tr><td>MMC_GET_SDSTAT</td><td>SD STATUSWX^̓e<tt class="arg">buff</tt>̎64oCg̃obt@ɓǂݏo܂B(SDJ[hp)</td></tr>
-<tr><td>ATA_GET_REV</td><td>rWER[h<tt class="arg">buff</tt>̎16oCg̃obt@ɓǂݏo܂B(ATA/CFJ[hp)</td></tr>
-<tr><td>ATA_GET_MODEL</td><td>fER[h<tt class="arg">buff</tt>̎40oCg̃obt@ɓǂݏo܂B(ATA/CFJ[hp)</td></tr>
-<tr><td>ATA_GET_SN</td><td>VAԍ<tt class="arg">buff</tt>̎20oCg̃obt@ɓǂݏo܂B(ATA/CFJ[hp)</td></tr>
+<caption>ユーザ定義ioctlコマンドの例</caption>
+<tr><th>コマンド</th><th>解説</th></tr>
+<tr><td>CTRL_FORMAT</td><td>メディアの物理フォーマットを行います。<tt class="arg">buff</tt>はNULLでないとき、進行表示のためのコールバック関数のアドレスを示します。</td></tr>
+<tr><td>CTRL_POWER_IDLE</td><td>デバイスをアイドル状態にします。通常の読み書き要求でアクティブ状態に戻るなら、<tt>STA_NOINIT</tt>フラグをセットする必要はありません。</td></tr>
+<tr><td>CTRL_POWER_OFF</td><td>デバイスをシャットダウン状態にします。<tt>STA_NOINIT</tt>はセットされます。デバイスは<tt>disk_initialize()</tt>でアクティブ状態に戻ります。</td></tr>
+<tr><td>CTRL_LOCK</td><td>ユーザによるメディアの取り出しを禁止します。</td></tr>
+<tr><td>CTRL_UNLOCK</td><td>ユーザによるメディアの取り出しを許可します。</td></tr>
+<tr><td>CTRL_EJECT</td><td>メディアを排出します。完了後、<tt>STA_NOINIT</tt>と<tt>STA_NODISK</tt>フラグはセットされます。</td></tr>
+<tr><td>MMC_GET_TYPE</td><td>カード タイプを示すフラグ(b0:MMCv3, b1:SDv1, b2:SDv2+, b3:LBA)を<tt class="arg">buff</tt>の示す<tt>BYTE</tt>変数に読み出します。(MMC/SDカード専用)</td></tr>
+<tr><td>MMC_GET_CSD</td><td>CSDレジスタの内容を<tt class="arg">buff</tt>の示す16バイトのバッファに読み出します。(MMC/SDカード専用)</td></tr>
+<tr><td>MMC_GET_CID</td><td>CIDレジスタの内容を<tt class="arg">buff</tt>の示す16バイトのバッファに読み出します。(MMC/SDカード専用)</td></tr>
+<tr><td>MMC_GET_OCR</td><td>OCRレジスタの内容を<tt class="arg">buff</tt>の示す4バイトのバッファに読み出します。(MMC/SDカード専用)</td></tr>
+<tr><td>MMC_GET_SDSTAT</td><td>SD STATUSレジスタの内容を<tt class="arg">buff</tt>の示す64バイトのバッファに読み出します。(SDカード専用)</td></tr>
+<tr><td>ATA_GET_REV</td><td>リビジョン コードを<tt class="arg">buff</tt>の示す16バイトのバッファに読み出します。(ATA/CFカード専用)</td></tr>
+<tr><td>ATA_GET_MODEL</td><td>モデル コードを<tt class="arg">buff</tt>の示す40バイトのバッファに読み出します。(ATA/CFカード専用)</td></tr>
+<tr><td>ATA_GET_SN</td><td>シリアル番号を<tt class="arg">buff</tt>の示す20バイトのバッファに読み出します。(ATA/CFカード専用)</td></tr>
</table>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p>[hEI[\ŁAƒZN^ETCYŒ\̂Ƃ́Å֐͕KvƂ܂B</p>
+<h4>対応情報</h4>
+<p>リード オンリー構成で、かつセクタ サイズ固定構成のときは、この関数は必要とされません。</p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/dread.html b/fatfs/doc/ja/dread.html
index 18b4238..2dac64e 100644
--- a/fatfs/doc/ja/dread.html
+++ b/fatfs/doc/ja/dread.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/dread.html">
@@ -13,59 +13,60 @@
<div class="para func">
<h2>disk_read</h2>
-<p>Xg[WEfoCXf[^ǂݏo܂B</p>
+<p>ストレージ デバイスからデータを読み出します。</p>
<pre>
DRESULT disk_read (
- BYTE <span class="arg">pdrv</span>, <span class="c">/* [IN] hCuԍ */</span>
- BYTE* <span class="arg">buff</span>, <span class="c">/* [OUT] ǂݏoobt@ւ̃|C^ */</span>
- DWORD <span class="arg">sector</span>, <span class="c">/* [IN] ǂݏoJnZN^ԍ */</span>
- UINT <span class="arg">count</span> <span class="c">/* [IN] ǂݏoZN^ */</span>
+ BYTE <span class="arg">pdrv</span>, <span class="c">/* [IN] 物理ドライブ番号 */</span>
+ BYTE* <span class="arg">buff</span>, <span class="c">/* [OUT] 読み出しバッファへのポインタ */</span>
+ DWORD <span class="arg">sector</span>, <span class="c">/* [IN] 読み出し開始セクタ番号 */</span>
+ UINT <span class="arg">count</span> <span class="c">/* [IN] 読み出すセクタ数 */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>pdrv</dt>
-<dd>Ώۂ̃foCXhCuԍ(0-9)w肳܂B</dd>
+<dd>対象のデバイスを示す物理ドライブ番号(0-9)が指定されます。シングル ドライブ システムでは、常に0が指定されます。</dd>
<dt>buff</dt>
-<dd>Xg[WEfoCXǂݏof[^i[<em>oCgz</em>w肳܂B</dd>
+<dd>ストレージ デバイスから読み出したデータを格納する<em>バイト配列</em>が指定されます。</dd>
<dt>sector</dt>
-<dd>ǂݏoJnZN^ԍBLBAŎw肳܂B</dd>
+<dd>読み出しを開始するセクタ番号。32ビットLBAで指定されます。</dd>
<dt>count</dt>
-<dd>ǂݏoZN^BFatFšĂяoł1`128͈̔͂Ɍ܂B</dd>
+<dd>読み出すセクタ数(1~128)。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<dl class="ret">
<dt>RES_OK (0)</dt>
-<dd>IB</dd>
+<dd>正常終了。</dd>
<dt>RES_ERROR</dt>
-<dd>ǂݍݒɃG[Ả񕜂ɂsB</dd>
+<dd>読み込み中にエラーが発生し、その回復にも失敗した。</dd>
<dt>RES_PARERR</dt>
-<dd>p[^sB</dd>
+<dd>パラメータが不正。</dd>
<dt>RES_NOTRDY</dt>
-<dd>hCu”\Ԃł͂ȂiĂȂjB</dd>
+<dd>ドライブが動作可能状態ではない(初期化されていない)。</dd>
</dl>
</div>
<div class="para desc">
-<h4></h4>
-<p><tt class="arg">buff</tt><tt>BYTE</tt>^Ȃ̂ŁAw肳AhX<em>Ƀ[hEACgĂƂ͌܂</em>BACgEAhXւ̓]́A<a href="appnote.html#fs1">ړ]</a>ɂĔ邱Ƃ܂BAn[hEFA̐ł̂悤ȓ]s”\ȂƂ́Å֐œi]Ȃǂĉ邩A܂͕ʂ̕@őΉȂ΂Ȃ܂Bɂ‚̑Ή@܂(ꂩ‚OK)B</p>
+<h4>解説</h4>
+<p>ストレージ デバイスに対するデータの読み書きは、セクタ単位で行われます。FatFsでは512~4096バイトのセクタ サイズをサポートします。固定セクタ サイズ構成(<tt>_MIN_SS == MAX_SS</tt>)のときは、暗黙的にそのセクタ サイズで動作しなければなりません。可変セクタ サイズ構成(<tt>_MIN_SS &lt; MAX_SS</tt>)</p>のときは、初期化後<tt>disk_ioctl()</tt>でセクタ サイズを問い合わせてくるので、それに対して正しい値を返す必要があります。</t>
+<p><tt class="arg">buff</tt>は<tt>BYTE</tt>型なので、指定されるアドレスは<em>常にワード アライメントされているとは限りません</em>。非アライメント アドレスへの転送は、<a href="appnote.html#fs1">直接転送</a>において発生することがあります。もしも、ハードウェア上の制約でそのような転送が不可能なときは、この関数内で二段転送するなどして解決するか、または別の方法で対応しなければなりません。次にいくつかの対応方法を示します(いずれか一つでOK)。</p>
<ul>
-<li>̊֐ʼn - </li>
-<li><tt>f_read()</tt>ɂāAZN^Ŝ܂ޓ] - ړ]Ȃ</li>
-<li><tt>f_read(fp, buff, btr, &amp;br)</tt>ɂāA<tt>(((UINT)buff &amp; 3) == (f_tell(fp) &amp; 3))</tt>𖞑 - <tt class="arg">buff</tt>̃[hEACgۏ؂</li>
+<li>この関数内で解決する - 推奨</li>
+<li><tt>f_read()</tt>において、セクタ全体を含む転送を避ける - 直接転送が発生しない</li>
+<li><tt>f_read(fp, buff, btr, &amp;br)</tt>において、<tt>(((UINT)buff &amp; 3) == (f_tell(fp) &amp; 3))</tt>を満足させる - <tt class="arg">buff</tt>のワード アライメントが保証される</li>
</ul>
-<p>ʓIɁAZN^̓]v́AXg[WEfoCXɑ΂ĉ”\Ȍ}`EZN^]Ȃ΂Ȃ܂B̃VOEZN^ǂݏoɕꂽꍇAX[vbgቺ邱Ƃ܂B</p>
+<p>一般的に、複数セクタの転送要求は、ストレージ デバイスに対して可能な限りマルチ セクタ転送しなければなりません。複数のシングル セクタ読み出しに分解された場合、スループットが低下することがあります。</p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/dstat.html b/fatfs/doc/ja/dstat.html
index a74fc30..6a30944 100644
--- a/fatfs/doc/ja/dstat.html
+++ b/fatfs/doc/ja/dstat.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/dstat.html">
@@ -13,36 +13,36 @@
<div class="para func">
<h2>disk_status</h2>
-<p>Xg[WEfoCX̏Ԃ擾܂B</p>
+<p>ストレージ デバイスの状態を取得します。</p>
<pre>
DSTATUS disk_status (
- BYTE <span class="arg">pdrv</span> <span class="c">/* [IN] hCuԍ */</span>
+ BYTE <span class="arg">pdrv</span> <span class="c">/* [IN] 物理ドライブ番号 */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>pdrv</dt>
-<dd>Ώۂ̃foCXhCuԍ(0-9)w肳܂B</dd>
+<dd>対象のデバイスを識別する物理ドライブ番号(0-9)が指定されます。物理ドライブが1台のときは、常に0になります。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
-<p>Xg[WEfoCX̏Ԃ̃tȎgݍ킹lŕԂ܂B</p>
+<h4>戻り値</h4>
+<p>現在のストレージ デバイスの状態を次のフラグの組み合わせ値で返します。</p>
<dl class="ret">
<dt>STA_NOINIT</dt>
-<dd>foCXĂȂƂtOBVXeEZbg⃁fBA̎OŃZbgA<tt>disk_initialize()</tt>̐IŃNAAsŃZbg܂BfBA͔񓯊ɔCxgȂ̂ŁAߋɃfBAꍇ̃tOɔfKv܂BFatFsW[́ÃtOQƂĎ}Egsǂ𔻒f܂B</dd>
+<dd>デバイスが初期化されていないことを示すフラグ。システム リセットやメディアの取り外し等でセットされ、<tt>disk_initialize()</tt>の正常終了でクリア、失敗でセットされます。メディア交換は非同期に発生するイベントなので、過去にメディア交換があった場合もこのフラグに反映させる必要があります。FatFsモジュールは、このフラグを参照してマウント動作が必要かどうかを判断します。</dd>
<dt>STA_NODISK</dt>
-<dd>fBA݂ȂƂtOBfBAOĂԂ̓ZbgAZbgĂԂ̓NA܂BŒfBXNł͏ɃNA܂BȂÃtOFatFsW[ł͎QƂ܂B</dd>
+<dd>メディアが存在しないことを示すフラグ。メディアが取り外されている間はセットされ、セットされている間はクリアされます。固定ディスクでは常にクリアします。なお、このフラグはFatFsモジュールでは参照されません。</dd>
<dt>STA_PROTECT</dt>
-<dd>fBACgEveNgĂ邱ƂtOBCgEveNg@\T|[gȂƂ́AɃNA܂B[hEI\ł͎QƂ܂B</dd>
+<dd>メディアがライト プロテクトされていることを示すフラグ。ライト プロテクト機能をサポートしないときは、常にクリアします。リード オンリ構成では参照されません。</dd>
</dl>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/dwrite.html b/fatfs/doc/ja/dwrite.html
index 41cebeb..15d4ead 100644
--- a/fatfs/doc/ja/dwrite.html
+++ b/fatfs/doc/ja/dwrite.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/dwrite.html">
@@ -13,64 +13,64 @@
<div class="para func">
<h2>disk_write</h2>
-<p>Xg[WEfoCXɃf[^݂܂B</p>
+<p>ストレージ デバイスにデータを書き込みます。</p>
<pre>
DRESULT disk_write (
- BYTE <span class="arg">pdrv</span>, <span class="c">/* [IN] hCuԍ */</span>
- const BYTE* <span class="arg">buff</span>, <span class="c">/* [IN] ރf[^ւ̃|C^ */</span>
- DWORD <span class="arg">sector</span>, <span class="c">/* [IN] ݊JnZN^ԍ */</span>
- UINT <span class="arg">count</span> <span class="c">/* [IN] ރZN^ */</span>
+ BYTE <span class="arg">pdrv</span>, <span class="c">/* [IN] 物理ドライブ番号 */</span>
+ const BYTE* <span class="arg">buff</span>, <span class="c">/* [IN] 書き込むデータへのポインタ */</span>
+ DWORD <span class="arg">sector</span>, <span class="c">/* [IN] 書き込み開始セクタ番号 */</span>
+ UINT <span class="arg">count</span> <span class="c">/* [IN] 書き込むセクタ数 */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>pdrv</dt>
-<dd>Ώۂ̃foCXhCuԍ(0-9)w肳܂B</dd>
+<dd>対象のデバイスを示す物理ドライブ番号(0-9)が指定されます。</dd>
<dt>buff</dt>
-<dd>Xg[WEfoCXɏރZN^Ef[^i[ꂽ<em>oCgz</em>w肳܂BoCǵAZN^ETCY*<tt class="arg">count</tt>ƂȂ܂B</dd>
+<dd>ストレージ デバイスに書き込むセクタ データが格納された<em>バイト配列</em>が指定されます。バイト数は、セクタ サイズ*<tt class="arg">count</tt>となります。</dd>
<dt>sector</dt>
-<dd>݂JnZN^ԍBLBAŎw肳܂B</dd>
+<dd>書き込みを開始するセクタ番号。32ビットLBAで指定されます。</dd>
<dt>count</dt>
-<dd>ރZN^BFatFšĂяoł1`128͈̔͂Ɍ܂B</dd>
+<dd>書き込むセクタ数(1~128)。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<dl class="ret">
<dt>RES_OK (0)</dt>
-<dd>IB</dd>
+<dd>正常終了。</dd>
<dt>RES_ERROR</dt>
-<dd>ݒɃG[Ả񕜂ɂsB</dd>
+<dd>書き込み中にエラーが発生し、その回復にも失敗した。</dd>
<dt>RES_WRPRT</dt>
-<dd>fBA݋֎~ԁB</dd>
+<dd>メディアが書き込み禁止状態。</dd>
<dt>RES_PARERR</dt>
-<dd>p[^sB</dd>
+<dd>パラメータが不正。</dd>
<dt>RES_NOTRDY</dt>
-<dd>foCX”\Ԃł͂ȂiĂȂjB</dd>
+<dd>デバイスが動作可能状態ではない(初期化されていない)。</dd>
</dl>
</div>
<div class="para desc">
-<h4></h4>
-<p><tt class="arg">buff</tt>Ɏw肳AhX<em>Ƀ[hEACgĂƂ͌܂</em>Bڍׂ́A<a href="dread.html"><tt>disk_read()</tt></a>̉QƂĂB</p>
-<p>ʓIɁAZN^̓]v́AfoCXɑ΂ĉ”\Ȍ}`EZN^]Ȃ΂Ȃ܂B̃VOEZN^݂ɕꂽꍇAX[vbgቺ邱Ƃ܂B</p>
-<p>FatFs̓fBXN֐x݋@\‚Ƃz肵Ă܂B̊֐߂ƂAfoCXݒƂLbVɏ܂ꂽȂǁAKf[^݂̏ĂKv͂܂BA<tt class="arg">buff</tt>̃f[^́Å֐߂ƖƂȂ܂B̗݊v́A<tt><a href="dioctl.html">disk_ioctl()</a></tt><tt>CTRL_SYNC</tt>R}hɂčs܂B̂悤Ȓx݋@\ꂽꍇAX[vbgɌコ邱Ƃł܂B</p>
-<p><em>AvP[V͂̊֐ĂяoĂ͂Ȃ܂BȂƁAFAT{[j󂳂”\܂B</em></p>
+<h4>解説</h4>
+<p><tt class="arg">buff</tt>に指定されるアドレスは<em>常にワード アライメントされているとは限りません</em>。詳細は、<a href="dread.html"><tt>disk_read()</tt></a>の解説を参照してください。</p>
+<p>一般的に、複数セクタの転送要求は、デバイスに対して可能な限りマルチ セクタ転送しなければなりません。複数のシングル セクタ書き込みに分解された場合、スループットが著しく低下することがあります。</p>
+<p>FatFsはディスク関数が遅延書き込み機能を持つことも想定しています。この関数から戻るとき、デバイスが書き込み中とかキャッシュに書き込まれただけなど、必ずしもメディアへの書き込みが完了している必要はありません。ただし、<tt class="arg">buff</tt>のデータは、この関数から戻ると無効となります。書き込み完了の要求は、<tt><a href="dioctl.html">disk_ioctl()</a></tt>の<tt>CTRL_SYNC</tt>コマンドによって行われます。このような遅延書き込み機能が実装された場合、スループットをさらに向上させることができます。</p>
+<p><em>アプリケーションからはこの関数を呼び出してはなりません。さもないと、FATボリュームが破壊される可能性があります。</em></p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p>[hEI[\(<tt>_FS_READONLY == 1</tt>)ł͂̊֐͕KvƂ܂B</p>
+<h4>対応情報</h4>
+<p>リード オンリー構成(<tt>_FS_READONLY == 1</tt>)ではこの関数は必要とされません。</p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/eof.html b/fatfs/doc/ja/eof.html
index b1f0e1a..b9098b3 100644
--- a/fatfs/doc/ja/eof.html
+++ b/fatfs/doc/ja/eof.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/eof.html">
@@ -13,50 +13,50 @@
<div class="para func">
<h2>f_eof</h2>
-<p>[h/CgE|C^t@CI[ɒBĂ邩ǂׂ܂B.</p>
+<p>リード/ライト ポインタがファイル終端に達しているかどうか調べます。.</p>
<pre>
int f_eof (
- FIL* <span class="arg">fp</span> <span class="c">/* [IN] t@CEIuWFNg */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル オブジェクト */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>fp</dt>
-<dd>t@CEIuWFNg\̂ւ̃|C^w肵܂B</dd>
+<dd>ファイル オブジェクト構造体へのポインタを指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
-<p>[h/CgE|C^t@CI[ɂǂݏof[^Ȃꍇ́A0ȊO̒lԂ܂BȊO̎0Ԃ܂B</p>
+<h4>戻り値</h4>
+<p>リード/ライト ポインタがファイル終端にあり読み出すデータがない場合は、0以外の値を返します。それ以外のときは0を返します。</p>
</div>
<div class="para desc">
-<h4></h4>
-<p>f_eof֐́ArWł̓}NƂĎĂ܂B</p>
+<h4>解説</h4>
+<p>f_eof関数は、現リビジョンではマクロとして実装されています。</p>
<pre>
-<span class="k">#define</span> f_eof(fp) (((fp)->fptr) == ((fp)->fsize) ? 1 : 0)
+<span class="k">#define</span> f_eof(fp) ((int)((fp)->fptr == (fp)->fsize))
</pre>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p>Ɏgp”\B</p>
+<h4>対応情報</h4>
+<p>常に使用可能。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/error.html b/fatfs/doc/ja/error.html
index ccd2f07..bb01d80 100644
--- a/fatfs/doc/ja/error.html
+++ b/fatfs/doc/ja/error.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/error.html">
@@ -13,50 +13,50 @@
<div class="para func">
<h2>f_error</h2>
-<p>G[̗L𒲂ׂ܂B</p>
+<p>エラー発生の有無を調べます。</p>
<pre>
int f_error (
- FIL* <span class="arg">fp</span> <span class="c">/* [IN] t@CEIuWFNg */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル オブジェクト */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>fp</dt>
-<dd>t@CEIuWFNg\̂ւ̃|C^w肵܂B</dd>
+<dd>ファイル オブジェクト構造体へのポインタを指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
-<p>t@C쒆̃G[ɂďfĂꍇ́A0ȊO̒lԂ܂BȊO̎0Ԃ܂B</p>
+<h4>戻り値</h4>
+<p>そのファイルにおいてハード エラーによって処理が中断されている場合は、0以外の値を返します。それ以外の時は0を返します。</p>
</div>
<div class="para desc">
-<h4></h4>
-<p>f_error֐́ArWł̓}NƂĎĂ܂B</p>
+<h4>解説</h4>
+<p>f_error関数は、現リビジョンではマクロとして実装されています。</p>
<pre>
-<span class="k">#define</span> f_error(fp) (((fp)->flag & FA__ERROR) ? 1 : 0)
+<span class="k">#define</span> f_error(fp) ((fp)->err)
</pre>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p>Ɏgp”\B</p>
+<h4>対応情報</h4>
+<p>常に使用可能。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/fattime.html b/fatfs/doc/ja/fattime.html
index 028ad53..c8bbed7 100644
--- a/fatfs/doc/ja/fattime.html
+++ b/fatfs/doc/ja/fattime.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/fattime.html">
@@ -13,7 +13,7 @@
<div class="para func">
<h2>get_fattime</h2>
-<p>ݎ擾܂B</p>
+<p>現在時刻を取得します。</p>
<pre>
DWORD get_fattime (void);
</pre>
@@ -21,37 +21,37 @@ DWORD get_fattime (void);
<div class="para ret">
-<h4>߂l</h4>
-<p>݂̃[JE^C<tt>DWORD</tt>lɃpbNĕԂ܂BrbgEtB[h͎Ɏ悤ɂȂ܂B</p>
+<h4>戻り値</h4>
+<p>現在のローカル タイムを<tt>DWORD</tt>値にパックして返します。ビット フィールドは次に示すようになります。</p>
<dl>
<dt>bit31:25</dt>
-<dd>1980NN_ƂN 0..127 ŃZbgB</dd>
+<dd>1980年を起点とした年を 0..127 でセット。</dd>
<dt>bit24:21</dt>
-<dd> 1..12 ̒lŃZbgB</dd>
+<dd>月を 1..12 の値でセット。</dd>
<dt>bit20:16</dt>
-<dd> 1..31 ̒lŃZbgB</dd>
+<dd>日を 1..31 の値でセット。</dd>
<dt>bit15:11</dt>
-<dd> 0..23 ̒lŃZbgB</dd>
+<dd>時を 0..23 の値でセット。</dd>
<dt>bit10:5</dt>
-<dd> 0..59 ̒lŃZbgB</dd>
+<dd>分を 0..59 の値でセット。</dd>
<dt>bit4:0</dt>
-<dd>b/2 0..29 ̒lŃZbg</dd>
+<dd>秒/2を 0..29 の値でセット</dd>
</dl>
</div>
<div class="para desc">
-<h4></h4>
-<p>RTCT|[gȂVXełA_~[Ƃĉ炩̓tƂėLȒlԂׂłB0ȂǂԂꍇÃt@C̃^CX^v͖ɂȂ܂B</p>
+<h4>解説</h4>
+<p>RTCをサポートしないシステムでも、ダミーとして何らかの日付として有効な値を返すべきです。0などを返した場合、そのファイルのタイムスタンプは無効になります。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p>[hEI[\(<tt>_FS_READONLY == 1</tt>)ł͂̊֐͕KvƂ܂B</p>
+<h4>対応情報</h4>
+<p>リード オンリー構成(<tt>_FS_READONLY == 1</tt>)ではこの関数は必要とされません。</p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/fdisk.html b/fatfs/doc/ja/fdisk.html
index 27f78b3..53b6cbb 100644
--- a/fatfs/doc/ja/fdisk.html
+++ b/fatfs/doc/ja/fdisk.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/fdisk.html">
@@ -13,30 +13,30 @@
<div class="para func">
<h2>f_fdisk</h2>
-<p>hCu𕪊܂B</p>
+<p>物理ドライブを分割します。</p>
<pre>
FRESULT f_fdisk (
- BYTE <span class="arg">pdrv</span>, <span class="c">/* [IN] hCuԍ */</span>
- const DWORD <span class="arg">part[]</span>, <span class="c">/* [IN] }bvEe[u */</span>
- void* <span class="arg">work</span> <span class="c">/* [-] [NGA */</span>
+ BYTE <span class="arg">pdrv</span>, <span class="c">/* [IN] 物理ドライブ番号 */</span>
+ const DWORD <span class="arg">part[]</span>, <span class="c">/* [IN] 区画マップ テーブル */</span>
+ void* <span class="arg">work</span> <span class="c">/* [-] ワークエリア */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>pdrv</dt>
-<dd><em>hCu</em>̃hCuԍw肵܂B</dd>
+<dd>分割する<em>物理ドライブ</em>のドライブ番号を指定します。</dd>
<dt>part[]</dt>
-<dd>}bvEe[uւ̃|C^w肵܂B</dd>
+<dd>区画マップ テーブルへのポインタを指定します。</dd>
<dt>work</dt>
-<dd>[NGAւ̃|C^w肵܂BTCY<tt>_MAX_SS</tt>oCgKvłB</dd>
+<dd>ワークエリアへのポインタを指定します。サイズは<tt>_MAX_SS</tt>バイト必要です。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -47,41 +47,41 @@ FRESULT f_fdisk (
</div>
<div class="para desc">
-<h4></h4>
-<p>̊֐́Aw肳ꂽhCuMBRɋe[u쐬܂B敪͈ʓIFDISK`ōs߁Aő4‚̊{쐬邱Ƃł܂Bgɂ͑ΉĂ܂B}bve[u<tt class="arg">part[]</tt>ɂ̓hCuǂ̂悤ɕ邩w肵ēn܂B̔z4‚̍ڂ琬A擪̍ڂ1Ԗڂ́AŌ̍ڂ4Ԗڂ̋̃TCY܂Bl100ȉ̏ꍇAhCȗeʂɑ΂銄p[ZgPʂŎw肵܂B100𒴂l̏ꍇ̓ZN^̒ڎwɂȂ܂B</p>
+<h4>説明</h4>
+<p>この関数は、指定された物理ドライブのMBRに区画テーブルを作成します。区画分けは一般的なFDISK形式で行うため、最大4つの基本区画を作成することができます。拡張区画には対応していません。区画マップテーブル<tt class="arg">part[]</tt>にはドライブをどのように分割するか指定して渡します。この配列は4つの項目から成り、先頭の項目が1番目の、最後の項目が4番目の区画のサイズを示します。値が100以下の場合、ドライブの総容量に対する割合をパーセント単位で指定します。100を超える値の場合はセクタ数の直接指定になります。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_READOLNY == 0</tt> <tt>_USE_MKFS == 1</tt> <tt>_MULTI_PARTITION == 1</tt> ̂Ƃgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_FS_READOLNY == 0</tt> で <tt>_USE_MKFS == 1</tt> で <tt>_MULTI_PARTITION == 1</tt> のとき使用可能です。</p>
</div>
<div class="para use">
-<h4>gp</h4>
+<h4>使用例</h4>
<pre>
- <span class="c">/* [U`̃{[Ǘe[u (_MULTI_PARTITION == 1 ̂ƂKv) */</span>
+ <span class="c">/* ユーザ定義のボリューム管理テーブル (_MULTI_PARTITION == 1 のとき必要) */</span>
PARTITION VolToPart[] = {
- {0, 1}, <span class="c">/* _hCu 0 ==> hCu 0, 1 */</span>
- {0, 2}, <span class="c">/* _hCu 1 ==> hCu 0, 2 */</span>
- {1, 0} <span class="c">/* _hCu 2 ==> hCu 1, o */</span>
+ {0, 1}, <span class="c">/* 論理ドライブ 0 ==> 物理ドライブ 0, 第1区画 */</span>
+ {0, 2}, <span class="c">/* 論理ドライブ 1 ==> 物理ドライブ 0, 第2区画 */</span>
+ {1, 0} <span class="c">/* 論理ドライブ 2 ==> 物理ドライブ 1, 自動検出 */</span>
};
</pre>
<pre>
- <span class="c">/* VhCu(0)̏ */</span>
+ <span class="c">/* 新しい物理ドライブ(0)の初期化 */</span>
FATFS fs;
- DWORD plist[] = {50, 50, 0, 0}; <span class="c">/* 2 */</span>
+ DWORD plist[] = {50, 50, 0, 0}; <span class="c">/* 2分割 */</span>
BYTE work[_MAX_SS];
- f_fdisk(0, plist, work); <span class="c">/* hCu 0 ̕ */</span>
+ f_fdisk(0, plist, work); <span class="c">/* 物理ドライブ 0 の分割 */</span>
f_mount(&amp;fs "0:", 0);
- f_mkfs("0:", 0, 0); <span class="c">/* _hCu 0 ̃tH[}bg. ͖. */</span>
+ f_mkfs("0:", 0, 0); <span class="c">/* 論理ドライブ 0 のフォーマット. 第二引数は無視される. */</span>
f_mount(0, "0:", 0);
f_mount(&amp;fs, "1:", 0);
- f_mkfs("1:", 0, 0); <span class="c">/* _hCu 0 ̃tH[}bg. ͖. */</span>
+ f_mkfs("1:", 0, 0); <span class="c">/* 論理ドライブ 0 のフォーマット. 第二引数は無視される. */</span>
f_mount(0, "1:", 0);
</pre>
diff --git a/fatfs/doc/ja/filename.html b/fatfs/doc/ja/filename.html
index c57d7aa..524566c 100644
--- a/fatfs/doc/ja/filename.html
+++ b/fatfs/doc/ja/filename.html
@@ -12,28 +12,28 @@
<body>
<h1>パス名のフォーマット</h1>
<div class="para" id="nam">
-<h3>ファイル・ディレクトリ名</h3>
+<h3>ファイル ディレクトリ名</h3>
<p>FatFsモジュールでのファイル、ディレクトリ、ドライブの指定方法はDOS/Windows APIとほぼ同じです。パス名のフォーマットは次の通りです。</p>
<pre>"[論理ドライブ番号:][/]ディレクトリ名/ファイル名"</pre>
-<p>FatFsモジュールは長いファイル名(LFN)および8.3形式ファイル名(SFN)に対応しています。LFNは、(<tt>_USE_LFN &gt; 0</tt>)のとき使用可能になります。ディレクトリ・セパレータにはDOS/Windows APIと同じく<tt>'/'</tt>と<tt>'\'</tt>を使用します。連続したセパレータは無視され1個として扱われます。唯一の違いは、論理ドライブの指定だけです。論理ドライブ番号は、<tt>'0'</tt>~<tt>'9'</tt>の一文字の数字とコロンで指定し、省略した場合は<em>デフォルト・ドライブ</em>(0またはカレント・ドライブ)が選択されます。</p>
+<p>FatFsモジュールは長いファイル名(LFN)および8.3形式ファイル名(SFN)に対応しています。LFNは、(<tt>_USE_LFN &gt; 0</tt>)のとき使用可能になります。ディレクトリ セパレータにはDOS/Windows APIと同じく<tt>'/'</tt>と<tt>'\'</tt>を使用します。連続したセパレータは無視され1個として扱われます。唯一の違いは、論理ドライブの指定だけです。論理ドライブ番号は、<tt>'0'</tt>~<tt>'9'</tt>の一文字の数字とコロンで指定し、省略した場合は<em>デフォルト ドライブ</em>(0またはカレント ドライブ)が選択されます。</p>
<p>ヌル文字や制御文字(<tt>'\0'</tt>~<tt>'\x1F'</tt>)は、パス名の終端として認識されます。パス名に先行あるいは中に含まれるスペースは、LFN構成では名前の一部として有効ですが、非LFN構成ではスペースはパス名の終端として認識されます。</p>
-<p>標準構成(<tt>_FS_RPATH == 0</tt>)のときは、全てのオブジェクトがルート・ディレクトリから辿る絶対パスで指定されます。OS指向なカレント・ディレクトリという概念は無く、またドット・ディレクトリ(&quot;.&quot;や&quot;..&quot;)は使用できません。パス名先頭のセパレータは無視されます。デフォルト・ドライブ番号は常に0になります。</p>
-<p>相対パスを有効(<tt>_FS_RPATH == 1</tt>)にしたときは、先行するセパレータの有無によって検索開始ディレクトリが変わり、セパレータがある場合はルート・ディレクトリから、無い場合は<a href="chdir.html"><tt>f_chdir()</tt></a>で設定されるカレント・ディレクトリからになります。またパス名にドット・ディレクトリが使用できます。デフォルト・ドライブ番号は<a href="chdrive.html"><tt>f_chdrive()</tt></a>で設定された値となります。</p>
+<p>標準構成(<tt>_FS_RPATH == 0</tt>)のときは、全てのオブジェクトがルート ディレクトリから辿る絶対パスで指定されます。OS指向なカレント ディレクトリという概念は無く、またドット ディレクトリ(&quot;.&quot;や&quot;..&quot;)は使用できません。パス名先頭のセパレータは無視されます。デフォルト ドライブ番号は常に0になります。</p>
+<p>相対パスを有効(<tt>_FS_RPATH == 1</tt>)にしたときは、先行するセパレータの有無によって検索開始ディレクトリが変わり、セパレータがある場合はルート ディレクトリから、無い場合は<a href="chdir.html"><tt>f_chdir()</tt></a>で設定されるカレント ディレクトリからになります。またパス名にドット ディレクトリが使用できます。デフォルト ドライブ番号は<a href="chdrive.html"><tt>f_chdrive()</tt></a>で設定された値となります。</p>
<table class="lst2">
<tr><td>パス名の例</td><td>_FS_RPATH == 0</td><td>_FS_RPATH == 1</td></tr>
-<tr class="lst3"><td>file.txt</td><td>ドライブ0のルート・ディレクトリ下のファイル</td><td>カレント・ドライブのカレント・ディレクトリ下のファイル</td></tr>
-<tr><td>/file.txt</td><td>ドライブ0のルート・ディレクトリ下のファイル</td><td>カレント・ドライブのルート・ディレクトリ下のファイル</td></tr>
-<tr><td></td><td>ドライブ0のルート・ディレクトリ</td><td>カレント・ドライブのカレント・ディレクトリ</td></tr>
-<tr><td>2:</td><td>ドライブ2のルート・ディレクトリ</td><td>ドライブ2のカレント・ディレクトリ</td></tr>
-<tr><td>2:file1.txt</td><td>ドライブ2のルート・ディレクトリ下のファイル</td><td>ドライブ2のカレント・ディレクトリ下のファイル</td></tr>
-<tr><td>2:/</td><td>ドライブ2のルート・ディレクトリ</td><td>ドライブ2のルート・ディレクトリ</td></tr>
+<tr class="lst3"><td>file.txt</td><td>ドライブ0のルート ディレクトリ下のファイル</td><td>カレント ドライブのカレント ディレクトリ下のファイル</td></tr>
+<tr><td>/file.txt</td><td>ドライブ0のルート ディレクトリ下のファイル</td><td>カレント ドライブのルート ディレクトリ下のファイル</td></tr>
+<tr><td></td><td>ドライブ0のルート ディレクトリ</td><td>カレント ドライブのカレント ディレクトリ</td></tr>
+<tr><td>2:</td><td>ドライブ2のルート ディレクトリ</td><td>ドライブ2のカレント ディレクトリ</td></tr>
+<tr><td>2:file1.txt</td><td>ドライブ2のルート ディレクトリ下のファイル</td><td>ドライブ2のカレント ディレクトリ下のファイル</td></tr>
+<tr><td>2:/</td><td>ドライブ2のルート ディレクトリ</td><td>ドライブ2のルート ディレクトリ</td></tr>
<tr><td>../file.txt</td><td>無効</td><td>親ディレクトリ下のファイル</td></tr>
<tr><td>.</td><td>無効</td><td>このディレクトリ</td></tr>
-<tr><td>..</td><td>無効</td><td>カレント・ディレクトリの親ディレクトリ</td></tr>
-<tr><td>dir1/..</td><td>無効</td><td>カレント・ディレクトリ</td></tr>
-<tr><td>/..</td><td>無効</td><td>ルート・ディレクトリ(その上は辿れない)</td></tr>
+<tr><td>..</td><td>無効</td><td>カレント ディレクトリの親ディレクトリ</td></tr>
+<tr><td>dir1/..</td><td>無効</td><td>カレント ディレクトリ</td></tr>
+<tr><td>/..</td><td>無効</td><td>ルート ディレクトリ(その上は辿れない)</td></tr>
</table>
-<p>また、<tt>_STR_VOLUME_ID</tt>オプションを有効にすることでドライブ番号の識別には数字のほか、任意の文字列を使用することも可能になります。</p>
+<p>また、<tt>_STR_VOLUME_ID</tt>オプションを有効にすることでドライブ番号の識別には数字のほか、<tt>"sd:file1.txt"</tt>や<tt>"ram:swapfile.dat"</tt>のように、任意の文字列を使用することも可能になります。</p>
</div>
<p><br></p>
@@ -62,13 +62,13 @@ PARTITION VolToPart[] = {
{0, 3}, <span class="c">/* 論理ドライブ 2 ==> 物理ドライブ 0, 第3区画 */</span>
{1, 0} <span class="c">/* 論理ドライブ 3 ==> 物理ドライブ 1, 自動検出 */</span>
};
-
-<img src="../img/f7.png" width="828" height="288" alt="論理ドライブと物理ドライブの関係">
</pre>
+<div><img src="../img/f7.png" width="828" height="288" alt="論理ドライブと物理ドライブの関係"></div>
<p>複数区画指定を使用する場合、次の点に注意しなければなりません。
<ul>
-<li>マウント可能な区画は基本区画のみで、拡張区画内には対応しない。</li>
<li>複数のマウントされた区画を持つ物理ドライブは、非リムーバブルでなければならず、システム動作中のメディア交換は禁止。</li>
+<li>基本区画のみマウント可能で、拡張区画内の区画には対応しない。</li>
+<li>Windowsは、リムーバブル ドライブでは複数区画をサポートせず、先頭区画のみ認識する。</li>
</ul>
</div>
diff --git a/fatfs/doc/ja/forward.html b/fatfs/doc/ja/forward.html
index ffb2e60..e9212ce 100644
--- a/fatfs/doc/ja/forward.html
+++ b/fatfs/doc/ja/forward.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/forward.html">
@@ -13,34 +13,34 @@
<div class="para func">
<h2>f_forward</h2>
-<p>t@Cf[^ǂݏoAMXg[ɒړ]܂B</p>
+<p>ファイルからデータを読み出し、送信ストリームに直接転送します。</p>
<pre>
FRESULT f_forward (
- FIL* <span class="arg">fp</span>, <span class="c">/* [IN] t@CEIuWFNg\ */</span>
- UINT (*<span class="arg">func</span>)(const BYTE*,UINT), <span class="c">/* [IN] f[^]֐ */</span>
- UINT <span class="arg">btf</span>, <span class="c">/* [IN] ]oCg */</span>
- UINT* <span class="arg">bf</span> <span class="c">/* [OUT] ]ꂽoCg */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [IN] ファイル オブジェクト構造体 */</span>
+ UINT (*<span class="arg">func</span>)(const BYTE*,UINT), <span class="c">/* [IN] データ転送関数 */</span>
+ UINT <span class="arg">btf</span>, <span class="c">/* [IN] 転送するバイト数 */</span>
+ UINT* <span class="arg">bf</span> <span class="c">/* [OUT] 転送されたバイト数 */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>fp</dt>
-<dd>t@CEIuWFNg\̂ւ̃|C^w肵܂B</dd>
+<dd>ファイル オブジェクト構造体へのポインタを指定します。</dd>
<dt>func</dt>
-<dd>f[^n[U`֐ւ̃|C^w肵܂B̊֐̎dl̓TvQƂĂB</dd>
+<dd>データを渡すユーザ定義関数へのポインタを指定します。この関数の仕様はサンプルを参照してください。</dd>
<dt>btf</dt>
-<dd>]oCg(0`UINT̍ől)w肵܂B</dd>
+<dd>転送するバイト数(0~UINTの最大値)を指定します。</dd>
<dt>bf</dt>
-<dd>ۂɓ]ꂽoCgi[ϐw|C^w肵܂B</dd>
+<dd>実際に転送されたバイト数を格納する変数を指すポインタを指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -54,40 +54,40 @@ FRESULT f_forward (
<div class="para desc">
-<h4></h4>
-<p>t@C̃f[^obt@ɓǂݏoɑMXg[ɒړ]܂BAvP[VŃf[^Eobt@KvƂȂ̂ŁǍꂽ‹ŗLłB[h/CgE|C^͓]ꂽoCgi݂܂Bw肳ꂽoCg̓]Ƀt@C̏I[ɒBꍇ⑗MXg[rW[ɂȂꍇA<tt class="arg">*bf</tt><tt class="arg">btf</tt>Ȃ܂B</p>
+<h4>解説</h4>
+<p>ファイルのデータをバッファに読み出さずに送信ストリームに直接転送します。アプリケーション側でデータ バッファを必要としないので、メモリの限られた環境で有効です。リード/ライト ポインタは転送されたバイト数だけ進みます。指定されたバイト数の転送中にファイルの終端に達した場合や送信ストリームがビジーになった場合、<tt class="arg">*bf</tt>は<tt class="arg">btf</tt>よりも小さくなります。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_USE_FORWARD == 1</tt>ŁA<tt>_FS_TINY == 1</tt>̂ƂɎgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_USE_FORWARD == 1</tt>で、且つ<tt>_FS_TINY == 1</tt>のときに使用可能です。</p>
</div>
<div class="para use">
-<h4>gpiI[fBIĐj</h4>
+<h4>使用例(オーディオ再生)</h4>
<pre>
<span class="c">/*-----------------------------------------------------------------------*/</span>
-<span class="c">/* f_forward֐Ă΂f[^M֐̗ */</span>
+<span class="c">/* f_forward関数から呼ばれるデータ送信関数の例 */</span>
<span class="c">/*-----------------------------------------------------------------------*/</span>
-UINT out_stream ( <span class="c">/* ߂l: ]ꂽoCg܂̓Xg[̏ */</span>
- const BYTE *p, <span class="c">/* ]f[^w|C^ */</span>
- UINT btf <span class="c">/* &gt;0: ]s(oCg). 0: Xg[̏Ԃ𒲂ׂ */</span>
+UINT out_stream ( <span class="c">/* 戻り値: 転送されたバイト数またはストリームの状態 */</span>
+ const BYTE *p, <span class="c">/* 転送するデータを指すポインタ */</span>
+ UINT btf <span class="c">/* &gt;0: 転送を行う(バイト数). 0: ストリームの状態を調べる */</span>
)
{
UINT cnt = 0;
- if (btf == 0) { <span class="c">/* ZXv */</span>
- <span class="c">/* Xg[̏ԂԂ (0: rW[, 1: fB) */</span>
- <span class="c">/* UAfBԂA]vŏȂƂ1oCg */</span>
- <span class="c">/* ]Ȃ f_forward֐ FR_INT_ERR ƂȂB */</span>
+ if (btf == 0) { <span class="c">/* センス要求 */</span>
+ <span class="c">/* ストリームの状態を返す (0: ビジー, 1: レディ) */</span>
+ <span class="c">/* 一旦、レディを返したら、続く転送要求で少なくとも1バイトは */</span>
+ <span class="c">/* 転送されないと f_forward関数は FR_INT_ERR となる。 */</span>
if (FIFO_READY) cnt = 1;
}
- else { <span class="c">/* ]v */</span>
- do { <span class="c">/* SẴoCg]邩AXg[rW[ɂȂ܂ŌJԂ */</span>
+ else { <span class="c">/* 転送要求 */</span>
+ do { <span class="c">/* 全てのバイトを転送するか、ストリームがビジーになるまで繰り返す */</span>
FIFO_PORT = *p++;
cnt++;
} while (cnt &lt; btf &amp;&amp; FIFO_READY);
@@ -98,31 +98,31 @@ UINT out_stream ( <span class="c">/* ߂l: ]ꂽoCg܂̓Xg[
<span class="c">/*-----------------------------------------------------------------------*/</span>
-<span class="c">/* f_forward֐̎gp */</span>
+<span class="c">/* f_forward関数の使用例 */</span>
<span class="c">/*-----------------------------------------------------------------------*/</span>
FRESULT play_file (
- char *fn <span class="c">/* ĐI[fBIEt@Cw|C^ */</span>
+ char *fn <span class="c">/* 再生するオーディオ ファイル名を指すポインタ */</span>
)
{
FRESULT rc;
FIL fil;
UINT dmy;
- <span class="c">/* t@Cǂݏo[hŊJ */</span>
+ <span class="c">/* ファイルを読み出しモードで開く */</span>
rc = f_open(&amp;fil, fn, FA_READ);
if (rc) return rc;
- <span class="c">/* SẴf[^]邩G[܂ő */</span>
+ <span class="c">/* 全てのデータが転送されるかエラーが発生するまで続ける */</span>
while (rc == FR_OK &amp;&amp; fil.fptr &lt; fil.fsize) {
- <span class="c">/* ق̏... */</span>
+ <span class="c">/* ほかの処理... */</span>
- <span class="c">/* I܂͗vɉăf[^Xg[ɑo */</span>
+ <span class="c">/* 定期的または要求に応じてデータをストリームに送出する */</span>
rc = f_forward(&amp;fil, out_stream, 1000, &amp;dmy);
}
- <span class="c">/* t@C‚Ė߂ */</span>
+ <span class="c">/* ファイルを閉じて戻る */</span>
f_close(&amp;fil);
return rc;
}
@@ -131,10 +131,10 @@ FRESULT play_file (
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="gets.html">fgets</a>, <a href="write.html">f_write</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/getcwd.html b/fatfs/doc/ja/getcwd.html
index b48f3fc..24e4844 100644
--- a/fatfs/doc/ja/getcwd.html
+++ b/fatfs/doc/ja/getcwd.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/getcwd.html">
@@ -13,28 +13,28 @@
<div class="para func">
<h2>f_getcwd</h2>
-<p>JgEfBNg𓾂܂B</p>
+<p>カレント ディレクトリを得ます。</p>
<pre>
FRESULT f_getcwd (
- TCHAR* <span class="arg">buff</span>, <span class="c">/* [OUT] obt@ */</span>
- UINT <span class="arg">len</span> <span class="c">/* [IN] obt@ETCY */</span>
+ TCHAR* <span class="arg">buff</span>, <span class="c">/* [OUT] バッファ */</span>
+ UINT <span class="arg">len</span> <span class="c">/* [IN] バッファ サイズ */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>buff</dt>
-<dd>JgEfBNg̃pXi[obt@</dd>
+<dd>カレント ディレクトリのパス名文字列を格納するバッファ</dd>
<dt>len</dt>
-<dd><tt>TCHAR</tt>Pʂ̃obt@ETCY</dd>
+<dd><tt>TCHAR</tt>単位のバッファ サイズ</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -49,22 +49,22 @@ FRESULT f_getcwd (
<div class="para desc">
-<h4></h4>
-<p>JgEhCũJgEfBNg̃tEpX擾܂B<tt>_VOLUMES</tt>2ȏ̂Ƃ́A_hCuԍ̕tꂽpXƂȂ܂B</p>
+<h4>解説</h4>
+<p>カレント ドライブのカレント ディレクトリのフル パス文字列を取得します。<tt>_VOLUMES</tt>が2以上のときは、論理ドライブ番号の付加されたパス名となります。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_RPATH == 2</tt>̂Ƃgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_FS_RPATH == 2</tt>のとき使用可能です。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="chdrive.html">f_chdrive</a>, <a href="chdir.html">f_chdir</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/getfree.html b/fatfs/doc/ja/getfree.html
index 4de40de..8b99c76 100644
--- a/fatfs/doc/ja/getfree.html
+++ b/fatfs/doc/ja/getfree.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/getfree.html">
@@ -13,31 +13,31 @@
<div class="para func">
<h2>f_getfree</h2>
-<p>{[̋󂫗̈̃TCY擾܂B</p>
+<p>ボリューム上の空き領域のサイズを取得します。</p>
<pre>
FRESULT f_getfree (
- const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] ΏۃhCuw肵܂ */</span>
- DWORD* <span class="arg">nclst</span>, <span class="c">/* [OUT] 󂫃NX^i[ϐւ̃|C^ */</span>
- FATFS** <span class="arg">fatfs</span> <span class="c">/* [OUT] t@CEVXeEIuWFNgw|C^ւ̃|C^ */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] 対象ドライブを指定します */</span>
+ DWORD* <span class="arg">nclst</span>, <span class="c">/* [OUT] 空きクラスタ数を格納する変数へのポインタ */</span>
+ FATFS** <span class="arg">fatfs</span> <span class="c">/* [OUT] ファイル システム オブジェクトを指すポインタへのポインタ */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>path</dt>
-<dd>ׂΏۂ̘_hCu<a href="filename.html">pX</a>k<tt>'\0'</tt>I[̕ւ̃|C^w肵܂Bk̓JgEhCuӖ܂B</dd>
+<dd>調べる対象の論理ドライブを示す<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。ヌル文字列はカレント ドライブを意味します。</dd>
<dt>nclst</dt>
-<dd>󂫃NX^i[<tt>DWORD</tt>^ϐւ̃|C^w肵܂B</dd>
+<dd>空きクラスタ数を格納する<tt>DWORD</tt>型変数へのポインタを指定します。</dd>
<dt>fatfs</dt>
-<dd>ΏۃhCũt@CEVXeEIuWFNgw|C^Ԃ܂B</dd>
+<dd>対象ドライブのファイル システム オブジェクトを指すポインタが返されます。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -52,33 +52,33 @@ FRESULT f_getfree (
<div class="para desc">
-<h4></h4>
-<p>_hCű󂫗̈̃TCYNX^PʂŎ擾܂BԂꂽt@CEVXeEIuWFNg<tt>csize</tt>oNX^̃ZN^Ă̂ŁAɃZN^Pʂ̋󂫃TCYvZł܂BFAT32{[ɂẮAFSINFȌ񂪎ۂ̋󂫃NX^ƓĂȂꍇAsmȒlԂ”\܂B̖邽߁A<tt>_FS_NOFSINFO</tt>IvVŃ}Eg͕̏KtFATXL悤ɍ\邱Ƃł܂B</p>
+<h4>解説</h4>
+<p>論理ドライブ上の空き領域のサイズをクラスタ単位で取得します。返されたファイル システム オブジェクトの<tt>csize</tt>メンバがクラスタあたりのセクタ数を示しているので、これを元にセクタ単位の空きサイズが計算できます。FAT32ボリュームにおいては、FSINFOの情報が実際の空きクラスタ数と同期していない場合、不正確な値を返す可能性があります。この問題を避けるため、<tt>_FS_NOFSINFO</tt>オプションでマウント後の初回は必ずフルFATスキャンをするように構成することもできます。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_READONLY == 0</tt>ŁA<tt>_FS_MINIMIZE == 0</tt>̂Ƃgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_FS_MINIMIZE == 0</tt>のとき使用可能です。</p>
</div>
<div class="para use">
-<h4>gp</h4>
+<h4>使用例</h4>
<pre>
FATFS *fs;
DWORD fre_clust, fre_sect, tot_sect;
- <span class="c">/* hCu1̃{[Ƌ󂫃NX^𓾂 */</span>
+ <span class="c">/* ドライブ1のボリューム情報と空きクラスタ数を得る */</span>
res = f_getfree("1:", &amp;fre_clust, &amp;fs);
if (res) die(res);
- <span class="c">/* SZN^Ƌ󂫃ZN^vZ */</span>
+ <span class="c">/* 全セクタ数と空きセクタ数を計算 */</span>
tot_sect = (fs->n_fatent - 2) * fs->csize;
fre_sect = fre_clust * fs->csize;
- <span class="c">/* {[Ŝ̃TCYƋ󂫂̃TCY\ (512oCg/ZN^Ɖ) */</span>
+ <span class="c">/* ボリューム全体のサイズと空きのサイズを表示 (512バイト/セクタと仮定) */</span>
printf("%10lu KiB total drive space.\n%10lu KiB available.\n",
tot_sect / 2, fre_sect / 2);
</pre>
@@ -86,10 +86,10 @@ FRESULT f_getfree (
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<tt><a href="sfatfs.html">FATFS</a></tt>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/getlabel.html b/fatfs/doc/ja/getlabel.html
index 957d212..bfcad0d 100644
--- a/fatfs/doc/ja/getlabel.html
+++ b/fatfs/doc/ja/getlabel.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/getlabel.html">
@@ -13,31 +13,31 @@
<div class="para func">
<h2>f_getlabel</h2>
-<p>{[Ex擾܂B</p>
+<p>ボリューム ラベルを取得します。</p>
<pre>
FRESULT f_getlabel (
- const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] ΏۃhCu */</span>
- TCHAR* <span class="arg">label</span>, <span class="c">/* [OUT] {[i[obt@ */</span>
- DWORD* <span class="arg">vsn</span> <span class="c">/* [OUT] {[EVAԍi[ϐ */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] 対象ドライブ */</span>
+ TCHAR* <span class="arg">label</span>, <span class="c">/* [OUT] ボリューム名を格納するバッファ */</span>
+ DWORD* <span class="arg">vsn</span> <span class="c">/* [OUT] ボリューム シリアル番号を格納する変数 */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>path</dt>
-<dd>ΏۂƂȂ_hCu<a href="filename.html">pX</a>k<tt>'\0'</tt>I[̕ւ̃|C^w肵܂Bk̏ꍇ́AftHgEhCuw肵ƂɂȂ܂B</dd>
+<dd>対象となる論理ドライブの<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。ヌル文字列の場合は、デフォルト ドライブを指定したことになります。</dd>
<dt>label</dt>
-<dd>{[i[zւ̃|C^w肵܂BȂƂ12vf̃TCYKvłB{[Ȃꍇ̓k񂪕Ԃ܂B̏񂪕svȂƂ̓kE|C^w肵ĂB</dd>
+<dd>ボリューム名を格納する配列へのポインタを指定します。少なくとも12要素のサイズが必要です。ボリューム名がない場合はヌル文字列が返されます。この情報が不要なときはヌル ポインタを指定してください。</dd>
<dt>vsn</dt>
-<dd>{[EVAԍi[<tt>DWORD</tt>^ϐւ̃|C^w肵܂B̏񂪕svȂƂ̓kE|C^w肵ĂB</dd>
+<dd>ボリューム シリアル番号を格納する<tt>DWORD</tt>型変数へのポインタを指定します。この情報が不要なときはヌル ポインタを指定してください。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -52,31 +52,31 @@ FRESULT f_getlabel (
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_USE_LABEL == 1</tt>̂ƂɎgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_USE_LABEL == 1</tt>のときに使用可能です。</p>
</div>
<div class="para use">
-<h4>gp</h4>
+<h4>使用例</h4>
<pre>
char str[12];
- <span class="c">/* ftHgEhCũ{[𓾂 */</span>
+ <span class="c">/* デフォルト ドライブのボリューム名を得る */</span>
f_getlabel("", str, 0);
- <span class="c">/* hCu2̃{[𓾂 */</span>
+ <span class="c">/* ドライブ2のボリューム名を得る */</span>
f_getlabel("2:", str, 0);
</pre>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<tt><a href="setlabel.html">f_setlabel</a></tt>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/gets.html b/fatfs/doc/ja/gets.html
index 2babef0..74e0b22 100644
--- a/fatfs/doc/ja/gets.html
+++ b/fatfs/doc/ja/gets.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/gets.html">
@@ -13,53 +13,53 @@
<div class="para func">
<h2>f_gets</h2>
-<p>t@C當ǂݏo܂B</p>
+<p>ファイルから文字列を読み出します。</p>
<pre>
TCHAR* f_gets (
- TCHAR* <span class="arg">buff</span>, <span class="c">/* [OUT] obt@ */</span>
- int <span class="arg">len</span>, <span class="c">/* [IN] obt@̃TCY */</span>
- FIL* <span class="arg">fp</span> <span class="c">/* [IN] t@CEIuWFNg */</span>
+ TCHAR* <span class="arg">buff</span>, <span class="c">/* [OUT] バッファ */</span>
+ int <span class="arg">len</span>, <span class="c">/* [IN] バッファのサイズ */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル オブジェクト */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>buff</dt>
-<dd>ǂݏoobt@w|C^w肵܂B</dd>
+<dd>文字列を読み出すバッファを指すポインタを指定します。</dd>
<dt>len</dt>
-<dd>obt@̃TCYvfŎw肵܂B</dd>
+<dd>バッファのサイズを要素数で指定します。</dd>
<dt>fp</dt>
-<dd>t@CEIuWFNg\̂ւ̃|C^w肵܂B</dd>
+<dd>ファイル オブジェクト構造体へのポインタを指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
-<p>֐<tt class="arg">buff</tt>Ԃ܂B</p>
+<h4>戻り値</h4>
+<p>関数が成功すると<tt class="arg">buff</tt>が返されます。</p>
</div>
<div class="para desc">
-<h4></h4>
-<p>̊֐<a href="read.html"><tt>f_read()</tt></a>̃bp[֐łBǂݏóAŏ<tt>'\n'</tt>ǂݍނAt@CI[ɒB邩A<tt class="arg">len</tt> - 1ǂݏo܂ő܂Bǂݍ܂ꂽ̏I[ɂ<tt>'\0'</tt>t܂BɃt@CI[1ǂݍ܂ȂƂA܂͉炩̃G[Ƃ͊֐͎skE|C^Ԃ܂Bt@CI[G[<tt>f_eof()</tt>,<tt>f_error()</tt>}NŒׂ܂B</p>
-<p>Unicode API\(<tt>_LFN_UNICODE == 1</tt>)IĂƂ́A<tt class="arg">buff</tt>UTF-16ɂȂ܂At@C̃GR[h́A<tt>_STRF_ENCODE</tt>IvVőIł܂BȊO͖̎ϊ(1oCg/1)œǂݏo܂B</p>
+<h4>解説</h4>
+<p>この関数は<a href="read.html"><tt>f_read()</tt></a>のラッパー関数です。読み出し動作は、最初の<tt>'\n'</tt>を読み込むか、ファイル終端に達するか、<tt class="arg">len</tt> - 1文字を読み出すまで続きます。読み込まれた文字列の終端には<tt>'\0'</tt>が付加されます。既にファイル終端で1文字も読み込まれなかったとき、または何らかのエラーが発生したときは関数は失敗しヌル ポインタを返します。ファイル終端かエラーかは<tt>f_eof()</tt>,<tt>f_error()</tt>マクロで調べられます。</p>
+<p>Unicode API構成(<tt>_LFN_UNICODE == 1</tt>)が選択されているときは、<tt class="arg">buff</tt>はUTF-16文字列になりますが、ファイル上のエンコードは、<tt>_STRF_ENCODE</tt>オプションで選択できます。それ以外の時は無変換(1バイト/1文字)で読み出します。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_USE_STRFUNC</tt>1܂2̂Ƃgp”\łB2̂Ƃ́At@CɊ܂܂<tt>'\r'</tt>菜ăobt@ɓǂݍ܂܂B</p>
+<h4>対応情報</h4>
+<p><tt>_USE_STRFUNC</tt>が1または2のとき使用可能です。2のときは、ファイルに含まれる<tt>'\r'</tt>が取り除かれてバッファに読み込まれます。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="putc.html">f_putc</a>, <a href="puts.html">f_puts</a>, <a href="printf.html">f_printf</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/lseek.html b/fatfs/doc/ja/lseek.html
index 5578852..88e1ab2 100644
--- a/fatfs/doc/ja/lseek.html
+++ b/fatfs/doc/ja/lseek.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/lseek.html">
@@ -13,28 +13,28 @@
<div class="para func">
<h2>f_lseek</h2>
-<p>t@C̃[h/CgE|C^ړ܂B܂AV[N@\gpɂCLMT(q)̍쐬ɂgp܂B</p>
+<p>ファイルのリード/ライト ポインタを移動します。また、高速シーク機能使用時にはCLMT(後述)の作成にも使用します。</p>
<pre>
FRESULT f_lseek (
- FIL* <span class="arg">fp</span>, <span class="c">/* [IN] t@CEIuWFNg\̂ւ̃|C^ */</span>
- DWORD <span class="arg">ofs</span> <span class="c">/* [IN] ړItZbg */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [IN] ファイル オブジェクト構造体へのポインタ */</span>
+ DWORD <span class="arg">ofs</span> <span class="c">/* [IN] 移動先オフセット */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>fp</dt>
-<dd>ΏۂƂȂt@CEIuWFNg\̂ւ̃|C^w肵܂B</dd>
+<dd>対象となるファイル オブジェクト構造体へのポインタを指定します。</dd>
<dt>ofs</dt>
-<dd>ړ̃ItZbg([h/CgE|C^)lBt@C擪̃ItZbgoCgPʂŎw肵܂B</dd>
+<dd>移動先のオフセット(リード/ライト ポインタ)値。ファイル先頭からのオフセットをバイト単位で指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -48,82 +48,82 @@ FRESULT f_lseek (
<div class="para desc">
-<h4></h4>
-<p>t@C̃[h/CgE|C^(ɓǂݏoE݂oCg̃ItZbg)ړ܂BItZbǧ_̓t@C擪łB݃[hŃt@CETCY傫Ȓlw肷ƁA܂Ńt@CETCYgAgꂽ̃f[^͖`ƂȂ܂Bf[^xɏ݂Ƃ́A\߂̊֐ŕKvȃTCY܂Ńt@CETCYgĂƗǂł傤B<tt>f_lseek()</tt>IƂ́A[h/CgE|C^ړ`FbNׂłB[h/CgE|C^w菬Ƃ́Ǎl܂B</p>
+<h4>解説</h4>
+<p>ファイルのリード/ライト ポインタ(次に読み出し・書き込みされるバイトのオフセット)を移動します。オフセットの原点はファイル先頭です。書き込みモードでファイル サイズより大きな値を指定すると、そこまでファイル サイズが拡張され、拡張された部分のデータは未定義となります。データを遅延無く高速に書き込みたいときは、予めこの関数で必要なサイズまでファイル サイズを拡張しておくと良いでしょう。<tt>f_lseek()</tt>が正常終了したあとは、リード/ライト ポインタが正しく移動したかチェックするべきです。リード/ライト ポインタが指定より小さいときは、次の原因が考えられます。</p>
<ul>
-<li>񏑂݃[h܂͍V[NE[ĥ߁At@CETCYŃNbvꂽB</li>
-<li>t@CgɃfBXNtɂȂB</li>
+<li>非書き込みモードまたは高速シーク モードのため、ファイル サイズでクリップされた。</li>
+<li>ファイル拡張中にディスクが満杯になった。</li>
</ul>
-<p><tt>_USE_FASTSEEK</tt>1ŁAƒt@CEIuWFNg<tt>cltbl</tt>oNULLȊO(<tt>f_open()</tt>NULLɐݒ肳)̂ƂAV[NE[hɂȂ܂B̓t@C̃NX^zu(CLMT)ɕێĂƂɂAFATɃANZX邱ƂȂV[N⃍OEV[Nɍs@\łBV[NE[h́A<tt>f_read()/f_wtite()</tt>̓ɂKp܂BV[NE[hł<tt>f_wtite()/f_lseek()</tt>ɂt@CETCY̊g͂ł܂B</p>
-<p>V[NsOɁACLMT쐬ĂKv܂B쐬ɂ́A܂CLMTi[obt@(<tt>DWORD</tt>^z)A<tt>cltbl</tt>oɂ̃|C^Zbg܂BāAz̐擪vfɂ̔z̃TCY(vf)A<tt>f_lseek()</tt><tt class="arg">ofs</tt><tt>CREATE_LINKMAP</tt>w肵ČĂяo܂B֐CLMT쐬Aȍ~<tt>f_read()/f_write()/f_lseek()</tt>łFATւ̃ANZX͔܂B<tt>FR_NOT_ENOUGH_CORE</tt>ŎsƂ͔zTCYsŁA擪vfɂ͎ۂɕKvƂȂvfԂ܂BKvȗvf́A(t@C̕ + 1) * 2 łBƂ΁At@C5‚̃tOgɕfĂƂɕKvȗvf́A12ƂȂ܂B</p>
+<p><tt>_USE_FASTSEEK</tt>が1で、且つファイル オブジェクトの<tt>cltbl</tt>メンバがNULL以外(<tt>f_open()</tt>でNULLに設定される)のとき、高速シーク モードになります。これはファイルのクラスタ配置情報(CLMT)をメモリ上に保持しておくことにより、FATにアクセスすることなく後方シークやロング シークを高速に行う機能です。高速シーク モードは、<tt>f_read()/f_wtite()</tt>の動作にも適用されます。高速シーク モードでは<tt>f_wtite()/f_lseek()</tt>によるファイル サイズの拡張はできません。</p>
+<p>高速シーク動作を行う前に、CLMTを作成しておく必要があります。これを作成するには、まずCLMT格納バッファ(<tt>DWORD</tt>型配列)を準備し、<tt>cltbl</tt>メンバにそのポインタをセットします。そして、配列の先頭要素にその配列のサイズ(要素数)を入れ、<tt>f_lseek()</tt>を<tt class="arg">ofs</tt>に<tt>CREATE_LINKMAP</tt>を指定して呼び出します。関数が成功するとCLMTが作成され、以降の<tt>f_read()/f_write()/f_lseek()</tt>ではFATへのアクセスは発生しません。<tt>FR_NOT_ENOUGH_CORE</tt>で失敗したときは配列サイズが不足で、先頭要素には実際に必要となる要素数が返されます。必要な要素数は、(ファイルの分割数 + 1) * 2 です。たとえば、ファイルが5つのフラグメントに分断されているときに必要な要素数は、12となります。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_MINIMIZE &lt; 3</tt>̂Ƃgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_FS_MINIMIZE &lt; 3</tt>のとき使用可能です。</p>
</div>
<div class="para use">
-<h4>gp</h4>
+<h4>使用例</h4>
<pre>
- <span class="c">/* t@CJ */</span>
+ <span class="c">/* ファイルを開く */</span>
fp = malloc(sizeof (FIL));
res = f_open(fp, "file.dat", FA_READ|FA_WRITE);
if (res) ...
- <span class="c">/* t@CEItZbg5000ֈړ */</span>
+ <span class="c">/* ファイル オフセット5000へ移動 */</span>
res = f_lseek(fp, 5000);
- <span class="c">/* t@CI[ֈړ(t@CNjL̏) */</span>
+ <span class="c">/* ファイル終端へ移動(ファイル追記の準備) */</span>
res = f_lseek(fp, f_size(fp));
- <span class="c">/* 3000oCgi߂ */</span>
+ <span class="c">/* 3000バイト進める */</span>
res = f_lseek(fp, f_tell(fp) + 3000);
- <span class="c">/* 2000oCg߂ (bvAEhɒ) */</span>
+ <span class="c">/* 2000バイト戻す (ラップアラウンドに注意) */</span>
res = f_lseek(fp, f_tell(fp) - 2000);
</pre>
<pre>
-<span class="c">/* NX^s蓖 (Xg[~OECg̃obt@EI[o[h~) */</span>
+<span class="c">/* クラスタ先行割り当て (ストリーミング ライト時のバッファ オーバーラン防止) */</span>
- res = f_open(fp, "record.wav", FA_CREATE_NEW | FA_WRITE); <span class="c">/* t@C쐬 */</span>
+ res = f_open(fp, "record.wav", FA_CREATE_NEW | FA_WRITE); <span class="c">/* ファイル作成 */</span>
- res = f_lseek(fp, MAX_SIZE); <span class="c">/* \ȃNX^̐s蓖 */</span>
- if (res || f_tell(fp) != PRE_SIZE) ... <span class="c">/* t@Cgꂽ`FbN */</span>
+ res = f_lseek(fp, MAX_SIZE); <span class="c">/* 十分なクラスタの先行割り当て */</span>
+ if (res || f_tell(fp) != PRE_SIZE) ... <span class="c">/* 正しくファイルが拡張されたかチェック */</span>
- res = f_lseek(fp, DATA_START); <span class="c">/* f[^EXg[̋L^(AP[VfBC) */</span>
+ res = f_lseek(fp, DATA_START); <span class="c">/* データ ストリームの記録(アロケーションディレイ無し) */</span>
...
- res = f_truncate(fp); <span class="c">/* sv̈̐؂̂ */</span>
- res = f_lseek(fp, 0); <span class="c">/* wb_̋L^ */</span>
+ res = f_truncate(fp); <span class="c">/* 不要領域の切り捨て */</span>
+ res = f_lseek(fp, 0); <span class="c">/* ヘッダの記録 */</span>
...
res = f_close(fp);
</pre>
<pre>
-<span class="c">/* V[N@\g */</span>
+<span class="c">/* 高速シーク機能を使う */</span>
- DWORD clmt[SZ_TBL]; <span class="c">/* NE}bvEe[ui[obt@ */</span>
+ DWORD clmt[SZ_TBL]; <span class="c">/* リンク マップ テーブル格納バッファ */</span>
- res = f_lseek(fp, ofs1); <span class="c">/* ʏV[N (I[vAcltblNULLɏ) */</span>
+ res = f_lseek(fp, ofs1); <span class="c">/* 通常シーク (オープン時、cltblはNULLに初期化される) */</span>
- fp-&gt;cltbl = clmt; <span class="c">/* V[N@\̗L */</span>
- clmt[0] = SZ_TBL; <span class="c">/* 擪vfɔzvfZbg */</span>
- res = f_lseek(fp, CREATE_LINKMAP); <span class="c">/* CLMT̍쐬 */</span>
+ fp-&gt;cltbl = clmt; <span class="c">/* 高速シーク機能の有効化 */</span>
+ clmt[0] = SZ_TBL; <span class="c">/* 先頭要素に配列要素数をセット */</span>
+ res = f_lseek(fp, CREATE_LINKMAP); <span class="c">/* CLMTの作成 */</span>
...
- res = f_lseek(fp, ofs2); <span class="c">/* ȍ~Af_read/f_write/f_lseekFATANZX͔Ȃ */</span>
+ res = f_lseek(fp, ofs2); <span class="c">/* 以降、f_read/f_write/f_lseekでFATアクセスは発生しない */</span>
</pre>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/mkdir.html b/fatfs/doc/ja/mkdir.html
index ef107d3..63da707 100644
--- a/fatfs/doc/ja/mkdir.html
+++ b/fatfs/doc/ja/mkdir.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/mkdir.html">
@@ -13,25 +13,25 @@
<div class="para func">
<h2>f_mkdir</h2>
-<p>fBNg쐬܂B</p>
+<p>ディレクトリを作成します。</p>
<pre>
FRESULT f_mkdir (
- const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] 쐬fBNgւ̃|C^ */</span>
+ const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] 作成するディレクトリ名へのポインタ */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>path</dt>
-<dd>쐬fBNg<a href="filename.html">pX</a>k<tt>'\0'</tt>I[̕ւ̃|C^w肵܂B</dd>
+<dd>作成するディレクトリの<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -52,19 +52,19 @@ FRESULT f_mkdir (
<div class="para desc">
-<h4></h4>
-<p>̃fBNg쐬܂B</p>
+<h4>解説</h4>
+<p>空のディレクトリを作成します。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_READONLY == 0</tt>ŁA<tt>_FS_MINIMIZE == 0</tt>̂Ƃgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_FS_MINIMIZE == 0</tt>のとき使用可能です。</p>
</div>
<div class="para use">
-<h4>gp</h4>
+<h4>使用例</h4>
<pre>
res = f_mkdir("sub1");
if (res) die(res);
@@ -75,6 +75,6 @@ FRESULT f_mkdir (
</pre>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/mkfs.html b/fatfs/doc/ja/mkfs.html
index 7e09696..19b4341 100644
--- a/fatfs/doc/ja/mkfs.html
+++ b/fatfs/doc/ja/mkfs.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/mkfs.html">
@@ -13,30 +13,30 @@
<div class="para func">
<h2>f_mkfs</h2>
-<p>_hCuFAT{[쐬(tH[}bg)܂B</p>
+<p>論理ドライブ上にFATボリュームを作成(フォーマット)します。</p>
<pre>
FRESULT f_mkfs (
- const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] _hCuԍ */</span>
- BYTE <span class="arg">sfd</span>, <span class="c">/* [IN] 쐬@ */</span>
- UINT <span class="arg">au</span> <span class="c">/* [IN] NXE^TCY */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] 論理ドライブ番号 */</span>
+ BYTE <span class="arg">sfd</span>, <span class="c">/* [IN] 区画作成方法 */</span>
+ UINT <span class="arg">au</span> <span class="c">/* [IN] クラス タサイズ */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>path</dt>
-<dd>tH[}bgΏۂ̘_hCu<a href="filename.html">pX</a>k<tt>'\0'</tt>I[̕ւ̃|C^w肵܂BhCuԍ܂܂Ȃꍇ́AJgEhCuӖ܂B</dd>
+<dd>フォーマット対象の論理ドライブを示す<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。ドライブ番号を含まない場合は、カレント ドライブを意味します。</dd>
<dt>sfd</dt>
-<dd>p[e[V`B(0(FDISK) ܂ 1(SFD))</dd>
+<dd>パーテーション形式。(0(FDISK) または 1(SFD))</dd>
<dt>au</dt>
-<dd>NX^ETCYoCgPʂŎw肵܂Bl͑ΏۃhCũZN^ETCYn{(n = 1`128ŁA2̗ݏ)łȂ΂Ȃ܂B0Ȃǂ̖lw肵ꍇA{[̃TCYɉftHg̃NX^ETCYI܂B</dd>
+<dd>クラスタ サイズをバイト数またはセクタ数で指定します。値が1~128の範囲場合は、セクタ数を示します。値が<tt>_MIN_SS</tt>以上の場合は、バイト数を示します。無効値(0または2の累乗でない値など)を指定した場合、ボリュームのサイズに応じたデフォルトのクラスタ サイズが自動選択されます。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -48,26 +48,64 @@ FRESULT f_mkfs (
</div>
<div class="para desc">
-<h4></h4>
-<p>hCuFAT{[쐬܂BFDISK`w肳ꂽꍇ́AhCuŜ߂{(p[e[V)쐬A̒FAT{[쐬܂BSFD`ł́AFAT{[hCu̐擪ZN^x^ō쐬܂B</p>
-<p>tH[}bg_hCu}`Ep[e[V@\(<tt>_MULTI_PARTITION</tt>)ɂē̋(1`4)ɌѕtĂꍇ́A̋̒FAT{[쐬܂B<tt class="arg">sfd</tt>͖A܂Ή镨hCu͂ɐ旧A<tt>f_fdisk()</tt>܂͑̃c[œK؂ɋݒ肳ĂKv܂B</p>
-<p>p[e[V`ɂ́AFDISK`SFD`̓ʂ肠܂BFDISK`́An[hfBXNAMMCASDCACFCAU DiskȂǂŕWIɎgp܂BFDISK`ł͈̕hCuɈ‚܂͕̋쐬邱Ƃł܂BǗMBR(hCu̐擪ZN^)ɋL^܂BSFD`͒Pɉ̕sȂ`ŁA{[͕hCu̐擪ZN^Jn܂BSFD`́Atbs[EfBXNA}CNhCuAwfBXNAт̑X[p[Etbs[EfBAŕWIɎgpĂ܂B</p>
-<p>FAT^Cv(FAT12/FAT16/FAT32)́Ã{[<em>NX^ɂĂ̂݌</em>錈܂[FATdl]ɂȂĂāAȊO̗v͂܂BāAǂFAT^CvɂȂ邩̓{[ETCYƃNX^ETCYɈˑ܂BNX^ETCY͑傫قǐ\オ܂B</p>
-<p>NX^FAT^Cv̋Eɋ߂ȂƂ́A<tt>FR_MKFS_ABORTED</tt>Ŋ֐s”\܂B</p>
+<h4>説明</h4>
+<p>物理ドライブ上にFATボリュームを作成します。FDISK形式が指定された場合は、物理ドライブ全体を占める基本区画(パーテーション)が作成され、その中にFATボリュームが作成されます。SFD形式では、FATボリュームが物理ドライブの先頭セクタからベタで作成されます。</p>
+<p>フォーマットする論理ドライブがマルチ パーテーション機能(<tt>_MULTI_PARTITION</tt>)によって特定の区画(1~4)に結び付けられている場合は、その区画の中にFATボリュームが作成されます。<tt class="arg">sfd</tt>は無視され、また対応する物理ドライブはこれに先立ち、<tt>f_fdisk()</tt>または他のツールで適切に区画設定されている必要があります。</p>
+<p>パーテーション形式には、FDISK形式とSFD形式の二通りあります。FDISK形式は、ハードディスク、MMC、SDC、CFC、U Diskなどで標準的に使用されます。FDISK形式では一台の物理ドライブ上に一つまたは複数の区画を作成することができます。区画管理情報はMBR(物理ドライブの先頭セクタ)に記録されます。SFD形式は単に何の分割も行わない形式で、ボリュームは物理ドライブの先頭セクタから開始します。SFD形式は、フロッピー ディスク、マイクロドライブ、光学ディスク、およびその他スーパー フロッピー メディアで標準的に使用されています。</p>
+<p>FATタイプ(FAT12/FAT16/FAT32)は、そのボリューム上の<em>クラスタ数によってのみ決定</em>される決まり[FAT仕様書より]になっていて、それ以外の要因はありません。したがって、どのFATタイプになるかはボリューム サイズとクラスタ サイズに依存します。クラスタ サイズは大きくするほど性能が上がります。</p>
+<p>クラスタ数がFATタイプの境界に近くなるときは、<tt>FR_MKFS_ABORTED</tt>で関数が失敗する可能性があります。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_READONLY == 0</tt>ŁA<tt>_USE_MKFS == 1</tt>̂Ƃgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_USE_MKFS == 1</tt>のとき使用可能です。</p>
+</div>
+
+
+<div class="para use">
+<h4>使用例</h4>
+<pre>
+<span class="c">/* Format the default drive */</span>
+int main (void)
+{
+ FATFS fs; <span class="c">/* File system object (volume work area) */</span>
+ FIL fil; <span class="c">/* File object */</span>
+ FRESULT res; <span class="c">/* API result code */</span>
+ UINT bw; <span class="c">/* Bytes written */</span>
+
+
+ <span class="c">/* Register work area */</span>
+ f_mount(&amp;fs, "", 0);
+
+ <span class="c">/* Create FAT volume with default cluster size */</span>
+ res = f_mkfs("", 0, 0);
+ if (res) ...
+
+ <span class="c">/* Create a file as new */</span>
+ res = f_open(&fil, "hello.txt", FA_CREATE_NEW | FA_WRITE);
+ if (res) ...
+
+ <span class="c">/* Write a message */</span>
+ f_write(&fil, "Hello, World!\r\n", 15, &bw);
+ if (bw != 15) ...
+
+ <span class="c">/* Close the file */</span>
+ f_close(&fil);
+
+ <span class="c">/* Unregister work area */</span>
+ f_mount(0, "", 0);
+
+</pre>
</div>
<div class="para ref">
-<h4>Q</h4>
-<p><tt><a href="filename.html#vol">{[Ǘ</a>, <a href="fdisk.html">f_fdisk</a></tt></p>
+<h4>参照</h4>
+<p><tt><a href="filename.html#vol">ボリューム管理</a>, <a href="fdisk.html">f_fdisk</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/mount.html b/fatfs/doc/ja/mount.html
index c6bc9f1..d465edb 100644
--- a/fatfs/doc/ja/mount.html
+++ b/fatfs/doc/ja/mount.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/mount.html">
@@ -13,30 +13,30 @@
<div class="para func">
<h2>f_mount</h2>
-<p>_hCuɃt@CEVXeEIuWFNgo^E܂B</p>
+<p>論理ドライブにファイル システム オブジェクトを登録・抹消します。</p>
<pre>
FRESULT f_mount (
- FATFS* <span class="arg">fs</span>, <span class="c">/* [IN] t@CEVXeEIuWFNg */</span>
- const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] _hCuԍ */</span>
- BYTE <span class="arg">opt</span> <span class="c">/* [IN] IvV */</span>
+ FATFS* <span class="arg">fs</span>, <span class="c">/* [IN] ファイル システム オブジェクト */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] 論理ドライブ番号 */</span>
+ BYTE <span class="arg">opt</span> <span class="c">/* [IN] オプション */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>fs</dt>
-<dd>o^t@CEVXeEIuWFNgւ̃|C^B</dd>
+<dd>登録するファイル システム オブジェクトへのポインタ。</dd>
<dt>path</dt>
-<dd>ΏۂƂȂ_hCu<a href="filename.html">pX</a>k'\0'I[̕ւ̃|C^w肵܂BhCuԍ܂܂Ȃꍇ́AftHgEhCuw肵ƂɂȂ܂B</dd>
+<dd>対象となる論理ドライブの<a href="filename.html">パス名</a>を示すヌル文字'\0'終端の文字列へのポインタを指定します。パス名にドライブ番号が含まれない場合は、デフォルト ドライブを指定したことになります。</dd>
<dt>opt</dt>
-<dd>t@CEVXeEIuWFNg̓o^ƓɃ}Egsǂw肷tOBo^̂Ƃ͈Ӗ܂B</dd>
+<dd>ファイル システム オブジェクトの登録と同時にマウント動作を行うかどうかを指定するフラグ。登録抹消のときは意味を持ちません。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#id">FR_INVALID_DRIVE</a>,
@@ -48,35 +48,35 @@ FRESULT f_mount (
<div class="para desc">
-<h4></h4>
-<p>FatFsW[ł́Aꂼ̘_hCu<em>t@CEVXeEIuWFNg</em>Ƃ[NEGAKvłB̊֐͘_hCuɃt@CEVXeEIuWFNgo^薕肵܂B炩̃t@C֐gpOɁÅ֐ł̘_hCũt@CEVXeEIuWFNg^ĂȂ΂Ȃ܂B<tt class="arg">fs</tt>ɃkE|C^w肷ƁA̘_hCũt@CEVXeEIuWFNg̓o^͖邾łBo^ꂽt@CEVXeEIuWFNg͉̃ł܂BΏۂ̘_hCuɊJĂt@CfBNgꍇA͑SĖɂȂ܂B̊֐͎̓̂悤ȏɍs܂B</p>
+<h4>解説</h4>
+<p>FatFsモジュールでは、それぞれの論理ドライブに<em>ファイル システム オブジェクト</em>というワーク エリアが必要です。この関数は論理ドライブにファイル システム オブジェクトを登録したり抹消したりします。何らかのファイル関数を使用する前に、この関数でその論理ドライブのファイル システム オブジェクトを与えておかなければなりません。<tt class="arg">fs</tt>にヌル ポインタを指定すると、その論理ドライブのファイル システム オブジェクトの登録は抹消されるだけです。登録抹消されたファイル システム オブジェクトのメモリは解放できます。操作対象の論理ドライブ上に開かれたままのファイルやディレクトリがあった場合、それらに対して作成された構造体は全て無効になります。この関数の内部処理は次のような順に行われます。</p>
<ol>
-<li>Ώۂ̘_hCu<tt class="arg">path</tt>瓾B</li>
-<li>ɓo^Ăt@CEVXeEIuWFNg̓NAAo^B</li>
-<li><tt class="arg">fs</tt>Lȃ|C^̂Ƃ́Ãt@CEVXeEIuWFNgNAo^B</li>
-<li>}Eg삪w肳ĂƂ́AsB</li>
+<li>対象の論理ドライブを<tt class="arg">path</tt>から得る。</li>
+<li>既に登録されているファイル システム オブジェクトはクリアし、登録を解除する。</li>
+<li><tt class="arg">fs</tt>が有効なポインタのときは、そのファイル システム オブジェクトをクリアし登録する。</li>
+<li>マウント動作が指定されているときは、それを実行する。</li>
</ol>
-<p><tt class="arg">opt</tt>0w肷ƁA}Eg(hCȕAFAT{[̌ABPB͂t@CEVXeEIuWFNg)͍sꂸA֐͕hCȕԂɊւ炸ɐ܂B֐ł͉ʃCւ̃ANZX͔Aw肳ꂽt@CEVXeEIuWFNgNA()ÃAhXzɓo^邾łBPɓo^ς݂̃t@CEVXeEIuWFNgNAړIɂg܂BāAă{[ւ̃ANZXsꂽƂ̂ꂩł^̏ꍇ́Aۂ̃}Eg삪s܂B</p>
+<p><tt class="arg">opt</tt>に0を指定すると、マウント動作(物理ドライブの初期化、FATボリュームの検索、BPBを解析しファイル システム オブジェクトを初期化)は行われず、関数は物理ドライブの状態に関わらず常に成功します。関数内では下位レイヤへのアクセスは発生せず、指定されたファイル システム オブジェクトをクリア(無効化)し、そのアドレスを内部配列に登録するだけです。単に登録済みのファイル システム オブジェクトをクリアする目的にも使えます。実際のマウント動作は、ボリュームへのアクセス(パス名を渡すもの全て)が行われたときに、次のうちいずれかの条件が真の場合に行われます。</p>
<ul>
-<li>t@CEVXeEIuWFNgNA()(<tt>f_mount()</tt>̎sɂ)</li>
-<li>hCu(VXeEZbg⃁fBǍɂ)</li>
+<li>ファイル システム オブジェクトがクリア(無効)状態(<tt>f_mount()</tt>の実行による)</li>
+<li>物理ドライブが未初期化状態(システム リセットやメディアの交換による)</li>
</ul>
-<p><tt class="arg">opt</tt>1w肷ƁAo^ɑă}Eg삪s܂B}EgɎsƑΉG[Ԃ܂Ao^͗LȂ̂ő{[ւ̃ANZXōĂу}Eg삪s܂B<p>
-<p>ʃC̎チfBǍoT|[gȂ(<tt>disk_status()</tt>ɔfȂ)Ƃ́AAvP[V̓fBǍケ̊֐Ńt@CEVXeEIuWFNg𖾎IɃNAčă}Egɍs悤ɂKv܂B</p>
+<p><tt class="arg">opt</tt>に1を指定すると、ファイル システムオブジェクトの登録に続きマウント動作が行われます。メディアが無いなどの理由でマウント動作に失敗すると対応するエラーを返しファイル システム オブジェクト無効状態のままになりますが、登録自体は有効なので続いてボリュームへのアクセスがあれば再びマウント動作が実行されます。</p>
+<p>下位レイヤの実装上メディア交換の検出がサポートされない(<tt>disk_status()</tt>に反映されない)ときは、アプリケーションはメディア交換の後この関数でファイル システム オブジェクトを明示的にクリアし、マウント動作が正常に行えるようにする必要があります。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p>SĂ̍\Ŏgp”\łB</p>
+<h4>対応情報</h4>
+<p>全ての構成で使用可能です。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="open.html">f_open</a></tt>, <tt><a href="sfatfs.html">FATFS</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/open.html b/fatfs/doc/ja/open.html
index a4c4a18..c308398 100644
--- a/fatfs/doc/ja/open.html
+++ b/fatfs/doc/ja/open.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/open.html">
@@ -13,33 +13,33 @@
<div class="para func">
<h2>f_open</h2>
-<p>t@CI[v܂͍쐬܂B</p>
+<p>ファイルをオープンまたは作成します。</p>
<pre>
FRESULT f_open (
- FIL* <span class="arg">fp</span>, <span class="c">/* [OUT] ̃t@CEIuWFNg\̂ւ̃|C^ */</span>
- const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] t@Cւ̃|C^ */</span>
- BYTE <span class="arg">mode</span> <span class="c">/* [IN] [htO */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [OUT] 空のファイル オブジェクト構造体へのポインタ */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] ファイル名へのポインタ */</span>
+ BYTE <span class="arg">mode</span> <span class="c">/* [IN] モードフラグ */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>fp</dt>
-<dd>V쐬t@CEIuWFNg\̂ւ̃|C^w肵܂Bȍ~Ãt@C‚܂ł̃t@CEIuWFNggpăt@C܂B</dd>
+<dd>新しく作成するファイル オブジェクト構造体へのポインタを指定します。以降、そのファイルを閉じるまでこのファイル オブジェクトを使用してファイル操作をします。</dd>
<dt>path</dt>
-<dd>Jt@C<a href="filename.html">t@C</a>k<tt>'\0'</tt>I[̕ւ̃|C^w肵܂B</dd>
+<dd>開くファイルの<a href="filename.html">ファイル名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。</dd>
<dt>mode</dt>
-<dd>t@C̃ANZX@I[v@߂tOłB̃p[^ɂ͎̑gݍ킹w肵܂B<br>
+<dd>ファイルのアクセス方法やオープン方法を決めるフラグです。このパラメータには次の組み合わせを指定します。<br>
<table class="lst">
-<tr><th>l</th><th>Ӗ</th></tr>
-<tr><td>FA_READ</td><td>ǂݏo[hŊJ܂Bǂݏꍇ<tt>FA_WRITE</tt>ƋɎw肵܂B</td></tr>
-<tr><td>FA_WRITE</td><td>݃[hŊJ܂Bǂݏꍇ<tt>FA_READ</tt>ƋɎw肵܂B</td></tr>
-<tr><td>FA_OPEN_EXISTING</td><td>̃t@CJ܂Bt@CƂ̓G[ɂȂ܂B(ftHg)</td></tr>
-<tr><td>FA_OPEN_ALWAYS</td><td>̃t@CJ܂Bt@CƂ̓t@C쐬܂BNjL̏ꍇ́A̕@ŃI[vA<a href="lseek.html"><tt>f_lseek()</tt></a>Ńt@C̍ŌɈړĂB</td></tr>
-<tr><td>FA_CREATE_NEW</td><td>t@C쐬܂B̃t@Cꍇ́A<tt>FR_EXIST</tt>Ŏs܂B</td></tr>
-<tr><td>FA_CREATE_ALWAYS</td><td>t@C쐬܂B̃t@Cꍇ́ATCY0ɂĂJ܂B</td></tr>
+<tr><th>値</th><th>意味</th></tr>
+<tr><td>FA_READ</td><td>読み出しモードで開きます。読み書きする場合は<tt>FA_WRITE</tt>と共に指定します。</td></tr>
+<tr><td>FA_WRITE</td><td>書き込みモードで開きます。読み書きする場合は<tt>FA_READ</tt>と共に指定します。</td></tr>
+<tr><td>FA_OPEN_EXISTING</td><td>既存のファイルを開きます。ファイルが無いときはエラーになります。(デフォルト)</td></tr>
+<tr><td>FA_OPEN_ALWAYS</td><td>既存のファイルを開きます。ファイルが無いときはファイルを作成します。追記の場合は、この方法でオープンした後、<a href="lseek.html"><tt>f_lseek()</tt></a>でファイルの最後尾に移動してください。</td></tr>
+<tr><td>FA_CREATE_NEW</td><td>ファイルを作成します。同名のファイルがある場合は、<tt>FR_EXIST</tt>で失敗します。</td></tr>
+<tr><td>FA_CREATE_ALWAYS</td><td>ファイルを作成します。同名のファイルがある場合は、サイズを0にしてから開きます。</td></tr>
</table>
</dd>
</dl>
@@ -47,7 +47,7 @@ FRESULT f_open (
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -72,86 +72,86 @@ FRESULT f_open (
<div class="para desc">
-<h4></h4>
-<p>̃t@CJAVt@C쐬܂B֐ƃt@CEIuWFNg쐬Aȍ~̃t@Cɑ΂ANZXɎgp܂Bt@C‚Ƃ́A<a href="close.html"><tt>f_close()</tt></a>gp܂B炩̕ύXsꂽt@Č㐳‚ȂꍇÃt@Cjꍇ܂B</p>
-<p>ɊJĂt@CJKvꍇ́A<a href="appnote.html#dup">dANZX</a>QƂĂBA‚̃t@Cɑ΂鏑݃[h܂ޏdI[v͏ɋ֎~łB</p>
-<p>t@CEANZXJnOɁA<a href="mount.html"><tt>f_mount()</tt></a>gĂꂼ̘_hCuɃ[NEGA(t@CEVXeEIuWFNg)^Kv܂B̏̌A̘_hCuɑ΂đSẴt@C֐g悤ɂȂ܂B</p>
+<h4>解説</h4>
+<p>既存のファイルを開いたり、新しいファイルを作成します。関数が成功するとファイル オブジェクトが作成され、以降そのファイルに対するアクセスに使用します。ファイルを閉じるときは、<a href="close.html"><tt>f_close()</tt></a>を使用します。何らかの変更が行われたファイルがその後正しく閉じられなかった場合、そのファイルが破損する場合があります。</p>
+<p>既に開かれているファイルを開く必要がある場合は、<a href="appnote.html#dup">多重アクセス制御</a>を参照してください。しかし、一つのファイルに対する書き込みモードを含む重複オープンは常に禁止です。</p>
+<p>ファイル アクセスを開始する前に、<a href="mount.html"><tt>f_mount()</tt></a>を使ってそれぞれの論理ドライブにワーク エリア(ファイル システム オブジェクト)を与える必要があります。この初期化の後、その論理ドライブに対して全てのファイル関数が使えるようになります。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p>SĂ̍\Ŏgp”\łB<tt>_FS_READONLY == 1</tt>̂Ƃ́A<tt>FA_WRITE, FA_CREATE_ALWAYS, FA_CREATE_NEW, FA_OPEN_ALWAYS</tt>̊etO̓T|[g܂B</p>
+<h4>対応情報</h4>
+<p>全ての構成で使用可能です。<tt>_FS_READONLY == 1</tt>のときは、<tt>FA_WRITE, FA_CREATE_ALWAYS, FA_CREATE_NEW, FA_OPEN_ALWAYS</tt>の各フラグはサポートされません。</p>
</div>
<div class="para use">
-<h4>gp</h4>
+<h4>使用例</h4>
<pre>
-<span class="c">/* eLXgt@Cǂݏoĕ\ */</span>
+<span class="c">/* テキストファイルを読み出して表示 */</span>
-FATFS FatFs; <span class="c">/* _hCũ[NEGA(t@CEVXeEIuWFNg) */</span>
+FATFS FatFs; <span class="c">/* 論理ドライブのワーク エリア(ファイル システム オブジェクト) */</span>
int main (void)
{
- FIL fil; <span class="c">/* t@CEIuWFNg */</span>
- char line[82]; <span class="c">/* sobt@ */</span>
- FRESULT fr; <span class="c">/* ߂l */</span>
+ FIL fil; <span class="c">/* ファイル オブジェクト */</span>
+ char line[82]; <span class="c">/* 行バッファ */</span>
+ FRESULT fr; <span class="c">/* 戻り値 */</span>
- <span class="c">/* ftHgEhCuɃ[NGA^ */</span>
+ <span class="c">/* デフォルト ドライブにワークエリアを与える */</span>
f_mount(&amp;FatFs, "", 0);
- <span class="c">/* eLXgEt@CJ */</span>
+ <span class="c">/* テキスト ファイルを開く */</span>
fr = f_open(&amp;fil, "message.txt", FA_READ);
if (fr) return (int)fr;
- <span class="c">/* 1s“ǂݏoĕ\ */</span>
+ <span class="c">/* 1行ずつ読み出して表示 */</span>
while (f_gets(line, sizeof line, &amp;fil))
printf(line);
- <span class="c">/* t@C‚ */</span>
+ <span class="c">/* ファイルを閉じる */</span>
f_close(&amp;fil);
return 0;
}
</pre>
<pre>
-<span class="c">/* hCu1̃t@C "file.bin" hCu0փRs[ */</span>
+<span class="c">/* ドライブ1のファイル "file.bin" をドライブ0へコピー */</span>
int main (void)
{
- FATFS fs[2]; <span class="c">/* _hCũ[NGA(t@CEVXeEIuWFNg) */</span>
- FIL fsrc, fdst; <span class="c">/* t@CEIuWFNg */</span>
+ FATFS fs[2]; <span class="c">/* 論理ドライブのワークエリア(ファイル システム オブジェクト) */</span>
+ FIL fsrc, fdst; <span class="c">/* ファイル オブジェクト */</span>
BYTE buffer[4096]; <span class="c">/* File copy buffer */</span>
FRESULT fr; <span class="c">/* FatFs function common result code */</span>
UINT br, bw; <span class="c">/* File R/W count */</span>
- <span class="c">/* hCu0,1Ƀ[NEGA^ */</span>
+ <span class="c">/* ドライブ0,1にワーク エリアを与える */</span>
f_mount(&amp;fs[0], "0:", 0);
f_mount(&amp;fs[1], "1:", 0);
- <span class="c">/* hCu1̃Rs[t@CJ */</span>
+ <span class="c">/* ドライブ1のコピー元ファイルを開く */</span>
res = f_open(&amp;fsrc, "1:file.dat", FA_OPEN_EXISTING | FA_READ);
if (fr) return (int)fr;
- <span class="c">/* hCu0ɃRs[t@C쐬 */</span>
+ <span class="c">/* ドライブ0にコピー先ファイルを作成する */</span>
res = f_open(&amp;fdst, "0:file.dat", FA_CREATE_ALWAYS | FA_WRITE);
if (fr) return (int)fr;
- <span class="c">/* Rs[Rs[Ƀf[^] */</span>
+ <span class="c">/* コピー元からコピー先にデータ転送する */</span>
for (;;) {
- res = f_read(&amp;fsrc, buffer, sizeof buffer, &amp;br); <span class="c">/* Rs[炩ǂݏo */</span>
- if (res || br == 0) break; <span class="c">/* G[t@CI[ */</span>
- res = f_write(&amp;fdst, buffer, br, &amp;bw); <span class="c">/* Rs[ɏ */</span>
- if (res || bw &lt; br) break; <span class="c">/* G[fBXNt */</span>
+ res = f_read(&amp;fsrc, buffer, sizeof buffer, &amp;br); <span class="c">/* コピー元からから読み出す */</span>
+ if (res || br == 0) break; <span class="c">/* エラーかファイル終端 */</span>
+ res = f_write(&amp;fdst, buffer, br, &amp;bw); <span class="c">/* それをコピー先に書き込む */</span>
+ if (res || bw &lt; br) break; <span class="c">/* エラーかディスク満杯 */</span>
}
- <span class="c">/* SẴt@C‚ */</span>
+ <span class="c">/* 全てのファイルを閉じる */</span>
f_close(&amp;fsrc);
f_close(&amp;fdst);
- <span class="c">/* [NEGAJ */</span>
+ <span class="c">/* ワーク エリアを開放する */</span>
f_mount(NULL, "0:", 0);
f_mount(NULL, "1:", 0);
@@ -162,10 +162,10 @@ int main (void)
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="read.html">f_read</a>, <a href="write.html">f_write</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a>, <a href="sfatfs.html">FATFS</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/opendir.html b/fatfs/doc/ja/opendir.html
index 9309160..ae40984 100644
--- a/fatfs/doc/ja/opendir.html
+++ b/fatfs/doc/ja/opendir.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/opendir.html">
@@ -13,28 +13,28 @@
<div class="para func">
<h2>f_opendir</h2>
-<p>fBNgJ܂B</p>
+<p>ディレクトリを開きます。</p>
<pre>
FRESULT f_opendir (
- DIR* <span class="arg">dp</span>, <span class="c">/* [OUT] fBNgEuWFNg\̂ւ̃|C^ */</span>
- const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] fBNgւ̃|C^ */</span>
+ DIR* <span class="arg">dp</span>, <span class="c">/* [OUT] ディレクトリ ブジェクト構造体へのポインタ */</span>
+ const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] ディレクトリ名へのポインタ */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>dp</dt>
-<dd>̃fBNgEIuWFNg\̂ւ̃|C^w肵܂B</dd>
+<dd>空のディレクトリ オブジェクト構造体へのポインタを指定します。</dd>
<dt>path</dt>
-<dd>I[vfBNg<a href="filename.html">pX</a>k<tt>'\0'</tt>I[̕ւ̃|C^w肵܂B</dd>
+<dd>オープンするディレクトリの<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -55,22 +55,22 @@ FRESULT f_opendir (
<div class="para desc">
-<h4></h4>
-<p>fBNgJ܂BIA쐬ꂽ<tt>DIR</tt>\̂gẴfBNg̍ڂǂݏo܂B</p>
+<h4>解説</h4>
+<p>ディレクトリを開きます。正常終了したら、作成された<tt>DIR</tt>構造体を使ってこのディレクトリの項目を順次読み出せます。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_MINIMIZE &lt;= 1</tt>̂Ƃgp”\ɂȂ܂B</p>
+<h4>対応情報</h4>
+<p><tt>_FS_MINIMIZE &lt;= 1</tt>のとき使用可能になります。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="readdir.html">f_readdir</a>, <a href="closedir.html">f_closedir</a>, <a href="sdir.html">DIR</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/printf.html b/fatfs/doc/ja/printf.html
index b5c22e0..4de1da2 100644
--- a/fatfs/doc/ja/printf.html
+++ b/fatfs/doc/ja/printf.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/printf.html">
@@ -13,56 +13,56 @@
<div class="para func">
<h2>f_printf</h2>
-<p>t@Cɏ݂܂B</p>
+<p>ファイルに書式化文字列を書き込みます。</p>
<pre>
int f_printf (
- FIL* <span class="arg">fp</span>, <span class="c">/* [IN] t@CEIuWFNg */</span>
- const TCHAR* <span class="arg">fmt</span>, <span class="c">/* [IN] 䕶 */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [IN] ファイル オブジェクト */</span>
+ const TCHAR* <span class="arg">fmt</span>, <span class="c">/* [IN] 書式制御文字列 */</span>
...
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>fp</dt>
-<dd>t@CEIuWFNg\̂ւ̃|C^w肵܂B</dd>
+<dd>ファイル オブジェクト構造体へのポインタを指定します。</dd>
<dt>fmt</dt>
-<dd>k<tt>'\0'</tt>I[̏䕶w|C^w肵܂Bk͏܂܂B</dd>
+<dd>ヌル文字<tt>'\0'</tt>終端の書式制御文字列を指すポインタを指定します。ヌル文字は書き込まれません。</dd>
<dt>...</dt>
-<dd>IvV̈B</dd>
+<dd>オプションの引数。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
-<p>񂪐ɏ܂ƁA܂ꂽԂ܂BfBXNt܂͂̑G[ɂ萳ɏ܂ȂƂ́A֐͎s<tt>EOF (-1)</tt>Ԃ܂B</p>
+<h4>戻り値</h4>
+<p>文字列が正常に書き込まれると、書き込まれた文字数が返されます。ディスクが満杯またはその他エラーにより正常に書き込まれなかったときは、関数は失敗し<tt>EOF (-1)</tt>が返されます。</p>
</div>
<div class="para desc">
-<h4></h4>
-<p>̊֐́A<a href="putc.html"><tt>f_putc()</tt></a><a href="puts.html"><tt>f_puts()</tt></a>̃bp[֐łB@\CWCũTuZbgƂȂĂāA䕶͎Ɏ̂gp”\łB</p>
+<h4>解説</h4>
+<p>この関数は、<a href="putc.html"><tt>f_putc()</tt></a>および<a href="puts.html"><tt>f_puts()</tt></a>のラッパー関数です。書式制御機能はC標準ライブラリのサブセットとなっていて、書式制御文字は次に示すものが使用可能です。</p>
<ul>
-<li>^Cv: <tt>c C s S d D u U x X b B</tt></li>
-<li>xw: <tt>l L</tt></li>
-<li>tO: <tt>0 -</tt></li>
+<li>タイプ: <tt>c C s S d D u U x X b B</tt></li>
+<li>精度指定: <tt>l L</tt></li>
+<li>フラグ: <tt>0 -</tt></li>
</ul>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_READONLY == 0</tt>ŁA<tt>_USE_STRFUNC</tt>1܂2̂Ƃgp”\ɂȂ܂B2̎́Ao͂Ɋ܂܂<tt>'\n'</tt><tt>'\r'+'\n'</tt>ɓWJăt@Cɏ܂܂B</p>
-<p>APIUnicodeI(<tt>_LFN_UNICODE</tt>1)ĂƂ́A<tt class="arg">fmt</tt>UnicodeɂȂ܂At@C̃GR[h́A<tt>_STRF_ENCODE</tt>IvVőIł܂BȊO͖̎ϊ(1oCg/1)ŏ݂܂B</p>
+<h4>対応情報</h4>
+<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_USE_STRFUNC</tt>が1または2のとき使用可能になります。2の時は、出力に含まれる<tt>'\n'</tt>が<tt>'\r'+'\n'</tt>に展開されてファイルに書き込まれます。</p>
+<p>APIにUnicodeが選択(<tt>_LFN_UNICODE</tt>が1)されているときは、<tt class="arg">fmt</tt>はUnicode文字列になりますが、ファイル上のエンコードは、<tt>_STRF_ENCODE</tt>オプションで選択できます。それ以外の時は無変換(1バイト/1文字)で書き込みます。</p>
</div>
<div class="para use">
-<h4>gp</h4>
+<h4>使用例</h4>
<pre>
f_printf(&amp;fil, "%d", 1234); <span class="c">/* "1234" */</span>
f_printf(&amp;fil, "%6d,%3d%%", -200, 5); <span class="c">/* " -200, 5%" */</span>
@@ -78,16 +78,16 @@ int f_printf (
f_printf(&amp;fil, "%8s", "abc"); <span class="c">/* " abc" */</span>
f_printf(&amp;fil, "%-8s", "abc"); <span class="c">/* "abc " */</span>
f_printf(&amp;fil, "%c", 'a'); <span class="c">/* "a" */</span>
- f_printf(&amp;fil, "%f", 10.0); <span class="c">/* _͖T|[g */</span>
+ f_printf(&amp;fil, "%f", 10.0); <span class="c">/* 浮動小数点は未サポート */</span>
</pre>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="putc.html">f_putc</a>, <a href="puts.html">f_puts</a>, <a href="gets.html">f_gets</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/putc.html b/fatfs/doc/ja/putc.html
index 724f4c2..6b80b1a 100644
--- a/fatfs/doc/ja/putc.html
+++ b/fatfs/doc/ja/putc.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/putc.html">
@@ -13,50 +13,50 @@
<div class="para func">
<h2>f_putc</h2>
-<p>t@Cɕ݂܂B</p>
+<p>ファイルに文字を書き込みます。</p>
<pre>
int f_putc (
- TCHAR <span class="arg">chr</span>, <span class="c">/* [IN] ޕ */</span>
- FIL* <span class="arg">fp</span> <span class="c">/* [IN] t@CEIuWFNg */</span>
+ TCHAR <span class="arg">chr</span>, <span class="c">/* [IN] 書き込む文字 */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル オブジェクト */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>chr</dt>
-<dd>ޕw肵܂B</dd>
+<dd>書き込む文字を指定します。</dd>
<dt>fp</dt>
-<dd>t@CEIuWFNg\̂ւ̃|C^w肵܂B</dd>
+<dd>ファイル オブジェクト構造体へのポインタを指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
-<p>ɏ܂Ə񂾕Ԃ܂BfBXNt܂̓G[ɂ菑܂ȂƂ<tt>EOF (-1)</tt>Ԃ܂B</p>
-<p>APIUnicodeI(<tt>_LFN_UNICODE</tt>1)ĂƂ́A<tt class="arg">chr</tt>UTF-16ɂȂ܂At@C̃GR[h́A<tt>_STRF_ENCODE</tt>IvVőIł܂BȊO͖̎ϊ(1oCg/1)ŏ݂܂B</p>
+<h4>戻り値</h4>
+<p>文字が正常に書き込まれると書き込んだ文字数が返されます。ディスクが満杯またはエラーにより書き込まれなかったときは<tt>EOF (-1)</tt>が返されます。</p>
+<p>APIにUnicodeが選択(<tt>_LFN_UNICODE</tt>が1)されているときは、<tt class="arg">chr</tt>はUTF-16文字になりますが、ファイル上のエンコードは、<tt>_STRF_ENCODE</tt>オプションで選択できます。それ以外の時は無変換(1バイト/1文字)で書き込みます。</p>
</div>
<div class="para desc">
-<h4></h4>
-<p>1t@Cɏ݂܂B̊֐<a href="write.html"><tt>f_write()</tt></a>̃bp[֐łB</p>
+<h4>解説</h4>
+<p>1文字をファイルに書き込みます。この関数は<a href="write.html"><tt>f_write()</tt></a>のラッパー関数です。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_READONLY == 0</tt>ŁA<tt>_USE_STRFUNC</tt> 1܂ 2̂Ƃgp”\łB2w肷ƁA<tt>'\n'</tt><tt>'\r'+'\n'</tt>ɓWJăt@Cɏ܂܂B</p>
+<h4>対応情報</h4>
+<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_USE_STRFUNC</tt>が 1または 2のとき使用可能です。2を指定すると、<tt>'\n'</tt>は<tt>'\r'+'\n'</tt>に展開されてファイルに書き込まれます。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="puts.html">f_puts</a>, <a href="printf.html">f_printf</a>, <a href="gets.html">f_gets</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/puts.html b/fatfs/doc/ja/puts.html
index d815311..4f3167c 100644
--- a/fatfs/doc/ja/puts.html
+++ b/fatfs/doc/ja/puts.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/puts.html">
@@ -13,50 +13,50 @@
<div class="para func">
<h2>f_puts</h2>
-<p>t@Cɕ݂܂B</p>
+<p>ファイルに文字列を書き込みます。</p>
<pre>
int f_puts (
- const TCHAR* <span class="arg">str</span>, <span class="c">/* [IN] ޕ */</span>
- FIL* <span class="arg">fp</span> <span class="c">/* [IN] t@CEIuWFNg */</span>
+ const TCHAR* <span class="arg">str</span>, <span class="c">/* [IN] 書き込む文字列 */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル オブジェクト */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>str</dt>
-<dd>ރk<tt>'\0'</tt>I[̕w|C^w肵܂Bk͏܂܂B</dd>
+<dd>書き込むヌル文字<tt>'\0'</tt>終端の文字列を指すポインタを指定します。ヌル文字は書き込まれません。</dd>
<dt>fp</dt>
-<dd>t@CEIuWFNg\̂ւ̃|C^w肵܂B</dd>
+<dd>ファイル オブジェクト構造体へのポインタを指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
-<p>񂪐ɏ܂ƁA܂ꂽԂ܂BfBXNt܂̓G[ɂ菑݂fꂽƂ<tt>EOF (-1)</tt>Ԃ܂B</p>
-<p>APIUnicodeI(<tt>_LFN_UNICODE</tt>1)ĂƂ́A<tt class="arg">str</tt>UTF-16ɂȂ܂At@C̃GR[h́A<tt>_STRF_ENCODE</tt>IvVőIł܂BȊO͖̎ϊ(1oCg/1)ŏ݂܂B</p>
+<h4>戻り値</h4>
+<p>文字列が正常に書き込まれると、書き込まれた文字数が返されます。ディスクが満杯またはエラーにより書き込みが中断されたときは<tt>EOF (-1)</tt>が返されます。</p>
+<p>APIにUnicodeが選択(<tt>_LFN_UNICODE</tt>が1)されているときは、<tt class="arg">str</tt>はUTF-16文字列になりますが、ファイル上のエンコードは、<tt>_STRF_ENCODE</tt>オプションで選択できます。それ以外の時は無変換(1バイト/1文字)で書き込みます。</p>
</div>
<div class="para desc">
-<h4></h4>
-<p>t@Cɏ݂܂B̊֐<a href="write.html"><tt>f_write()</tt></a>̃bp[֐łB</p>
+<h4>解説</h4>
+<p>文字列をファイルに書き込みます。この関数は<a href="write.html"><tt>f_write()</tt></a>のラッパー関数です。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_READONLY == 0</tt>ŁA<tt>_USE_STRFUNC</tt>1܂2̂Ƃgp”\łB2w肷ƁAɊ܂܂<tt>'\n'</tt><tt>'\r'+'\n'<tt>ɓWJăt@Cɏ܂܂B</p>
+<h4>対応情報</h4>
+<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_USE_STRFUNC</tt>が1または2のとき使用可能です。2を指定すると、文字列に含まれる<tt>'\n'</tt>は<tt>'\r'+'\n'<tt>に展開されてファイルに書き込まれます。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="putc.html">f_putc</a>, <a href="printf.html">f_printf</a>, <a href="gets.html">f_gets</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/rc.html b/fatfs/doc/ja/rc.html
index 8bcfb24..45a4738 100644
--- a/fatfs/doc/ja/rc.html
+++ b/fatfs/doc/ja/rc.html
@@ -11,20 +11,20 @@
<body>
<h1>ファイル関数の戻り値</h1>
-<p>FatFsのAPIでは、一部の関数を除き結果に応じた共通のリザルト・コード(FRESULT型(enum))を返します。関数が成功した場合は0を返します。失敗した場合は0以外の値を返し、値はエラーの種類を示します。</p>
+<p>FatFsのAPIでは、一部の関数を除き結果に応じた共通のリザルト コード(FRESULT型(enum))を返します。関数が成功した場合は0を返します。失敗した場合は0以外の値を返し、値はエラーの種類を示します。</p>
<dl class="ret">
<dt id="ok">FR_OK (0)</dt>
<dd>関数は成功した。</dd>
<dt id="de">FR_DISK_ERR</dt>
-<dd>下位レイヤ(<tt>disk_read(), disk_write(), disk_ioctl()</tt>関数)で回復不能なエラーが発生した。<br>※開かれたファイルの操作においてこのエラーが発生すると、そのファイル・オブジェクトはアボート状態となり、クローズ以外のの操作ができなくなります。</dd>
+<dd>下位レイヤ(<tt>disk_read(), disk_write(), disk_ioctl()</tt>関数)で回復不能なエラーが発生した。<br>※開かれたファイルの操作においてこのエラーが発生すると、そのファイル オブジェクトはアボート状態となり、クローズ以外のの操作ができなくなります。</dd>
<dt id="ie">FR_INT_ERR</dt>
<dd>内部処理の健全性に異常が検出された。原因としては次のようなことが考えられます。
<ul>
<li>ボリューム上のFAT構造にエラーがある。</li>
-<li>スタック不足や不正なメモリ操作等によるワーク・エリアの破壊。多くはこれが原因。</li>
+<li>スタック不足や不正なメモリ操作等によるワーク エリアの破壊。多くはこれが原因。</li>
</ul>
-※開かれたファイルの操作においてこのエラーが発生すると、そのファイル・オブジェクトはアボート状態となり、クローズ以外の操作ができなくなります。</dd>
+※開かれたファイルの操作においてこのエラーが発生すると、そのファイル オブジェクトはアボート状態となり、クローズ以外の操作ができなくなります。</dd>
<dt id="nr">FR_NOT_READY</dt>
<dd>物理ドライブが動作可能な状態にない。または、ドライブの初期化に失敗した。</dd>
<dt id="nf">FR_NO_FILE</dt>
@@ -38,22 +38,22 @@
<ul>
<li>書き込み禁止属性(<tt>AM_RDO</tt>)を持つファイルを書き込みモードで開こうとした。</li>
<li>書き込み禁止属性を持つファイルやディレクトリを削除しようとした。</li>
-<li>空でないディレクトリまたはカレント・ディレクトリを削除しようとした。</li>
+<li>空でないディレクトリまたはカレント ディレクトリを削除しようとした。</li>
<li><tt>FA_READ</tt>フラグを付けずに開いたファイルに対して読み出しを行った。</li>
<li><tt>FA_WRITE</tt>フラグを付けずに開いたファイルに対して書き込みまたはそれに類する操作を行った。</li>
-<li>ボリュームまたはディレクトリ・テーブルが満杯でファイルやディレクトリを作成できなかった。</li>
+<li>ボリュームまたはディレクトリ テーブルが満杯でファイルやディレクトリを作成できなかった。</li>
</ul>
</dd>
<dt id="ex">FR_EXIST</dt>
<dd>新しく作成しようとしたオブジェクトと同じ名前のオブジェクトが既に存在する。</dd>
<dt id="io">FR_INVALID_OBJECT</dt>
-<dd>指定されたファイル・オブジェクトやディレクトリ・オブジェクトが無効(オープンされていない、既に閉じられた、破損しているなど)、またはヌル・ポインタが渡された。また、開かれたままのオブジェクトは、それの属するボリュームのマウント動作により無効となります。</dd>
+<dd>指定されたファイル オブジェクトやディレクトリ オブジェクトが無効(オープンされていない、既に閉じられた、破損しているなど)、またはヌル ポインタが渡された。また、開かれたままのオブジェクトは、それの属するボリュームのマウント動作により無効となります。</dd>
<dt id="wp">FR_WRITE_PROTECTED</dt>
<dd>物理ドライブが書き込み禁止状態のとき、書き込みを伴う操作を行おうとした。</dd>
<dt id="id">FR_INVALID_DRIVE</dt>
-<dd>パス名中に指定されたドライブ番号が無効、またはパス名にヌル・ポインタが渡された。(関連オプション: <tt>_VOLUMES</tt>)</dd>
+<dd>パス名中に指定されたドライブ番号が無効、またはパス名にヌル ポインタが渡された。(関連オプション: <tt>_VOLUMES</tt>)</dd>
<dt id="ne">FR_NOT_ENABLED</dt>
-<dd>そのボリュームの操作に必要なワーク・エリア(ファイル・システム・オブジェクト構造体)が与えられていない。</dd>
+<dd>そのボリュームの操作に必要なワーク エリア(ファイル システム オブジェクト構造体)が与えられていない。</dd>
<dt id="ns">FR_NO_FILESYSTEM</dt>
<dd>物理ドライブ上に有効なFATボリュームが見つからなかった。</dd>
<dt id="ma">FR_MKFS_ABORTED</dt>
diff --git a/fatfs/doc/ja/read.html b/fatfs/doc/ja/read.html
index 04ef8b3..c7f2d25 100644
--- a/fatfs/doc/ja/read.html
+++ b/fatfs/doc/ja/read.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/read.html">
@@ -13,34 +13,34 @@
<div class="para func">
<h2>f_read</h2>
-<p>t@Cf[^ǂݏo܂B</p>
+<p>ファイルからデータを読み出します。</p>
<pre>
FRESULT f_read (
- FIL* <span class="arg">fp</span>, <span class="c">/* [IN] t@CEIuWFNg\ */</span>
- void* <span class="arg">buff</span>, <span class="c">/* [OUT] ǂݏof[^i[obt@ */</span>
- UINT <span class="arg">btr</span>, <span class="c">/* [IN] ǂݏooCg */</span>
- UINT* <span class="arg">br</span> <span class="c">/* [OUT] ǂݏoꂽoCg */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [IN] ファイル オブジェクト構造体 */</span>
+ void* <span class="arg">buff</span>, <span class="c">/* [OUT] 読み出したデータを格納するバッファ */</span>
+ UINT <span class="arg">btr</span>, <span class="c">/* [IN] 読み出すバイト数 */</span>
+ UINT* <span class="arg">br</span> <span class="c">/* [OUT] 読み出されたバイト数 */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>fp</dt>
-<dd>t@CEIuWFNg\̂ւ̃|C^w肵܂B</dd>
+<dd>ファイル オブジェクト構造体へのポインタを指定します。</dd>
<dt>buff</dt>
-<dd>ǂݏof[^i[obt@w|C^w肵܂B</dd>
+<dd>読み出したデータを格納するバッファを指すポインタを指定します。</dd>
<dt>btr</dt>
-<dd>ǂݏooCg(0`<tt>UINT</tt>^̍ől)w肵܂B</dd>
+<dd>読み出すバイト数(0~<tt>UINT</tt>型の最大値)を指定します。</dd>
<dt>br</dt>
-<dd>ۂɓǂݏoꂽoCgi[ϐw|C^w肵܂B߂l͊֐̐ۂɂ炸ɗLłB</dd>
+<dd>実際に読み出されたバイト数を格納する変数を指すポインタを指定します。戻り値は関数の成否にかかわらず常に有効です。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -54,22 +54,22 @@ FRESULT f_read (
<div class="para desc">
-<h4></h4>
-<p>ǂݍ݊JnʒúÃ݂[h/CgE|C^ɂȂ܂B[h/CgE|C^͓ǂݍ܂ꂽoCgi݂܂B֐ÍA<tt class="arg">*br</tt>̒l`FbNׂłB<tt class="arg">*br</tt><tt class="arg">btr</tt>Ƃ́AǂݍݒɃt@C̏I[ɒBƂĂ܂B</p>
+<h4>解説</h4>
+<p>読み込み開始位置は、現在のリード/ライト ポインタからになります。リード/ライト ポインタは読み込まれたバイト数だけ進みます。関数が正常終了した後は、<tt class="arg">*br</tt>の値をチェックすべきです。<tt class="arg">*br</tt>が<tt class="arg">btr</tt>よりも小さいときは、読み込み中にファイルの終端に達したことを示しています。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p>SĂ̍\Ŏgp”\łB</p>
+<h4>対応情報</h4>
+<p>全ての構成で使用可能です。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="gets.html">fgets</a>, <a href="write.html">f_write</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/readdir.html b/fatfs/doc/ja/readdir.html
index bd1c34e..fc8fc5c 100644
--- a/fatfs/doc/ja/readdir.html
+++ b/fatfs/doc/ja/readdir.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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">
@@ -13,28 +13,28 @@
<div class="para func">
<h2>f_readdir</h2>
-<p>fBNgڂǂݏo܂B</p>
+<p>ディレクトリ項目を読み出します。</p>
<pre>
FRESULT f_readdir (
- DIR* <span class="arg">dp</span>, <span class="c">/* [IN] fBNgEuWFNg\̂ւ̃|C^ */</span>
- FILINFO* <span class="arg">fno</span> <span class="c">/* [OUT] t@C\̂ւ̃|C^ */</span>
+ DIR* <span class="arg">dp</span>, <span class="c">/* [IN] ディレクトリ ブジェクト構造体へのポインタ */</span>
+ FILINFO* <span class="arg">fno</span> <span class="c">/* [OUT] ファイル情報構造体へのポインタ */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>dp</dt>
-<dd>LȃfBNgEIuWFNg\̂ւ̃|C^w肵܂B</dd>
+<dd>有効なディレクトリ オブジェクト構造体へのポインタを指定します。</dd>
<dt>fno</dt>
-<dd>ǂݏofBNgڂi[t@C\̂ւ̃|C^w肵܂B</dd>
+<dd>読み出したディレクトリ項目を格納するファイル情報構造体へのポインタを指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -48,37 +48,37 @@ FRESULT f_readdir (
<div class="para desc">
-<h4></h4>
-<p>fBNg̍(t@CƃfBNg)ǂݏo܂B̊֐JԂs邱Ƃɂ肻̃fBNg̑SĂ̍ڂǂݏoƂł܂Bt@C̏ڍׂɂ‚Ă <tt>FILINFO</tt>\̂QƂĂBSĂ̍ڂǂݏoAǂݏoڂƂ́A<tt>fname[]</tt>oɃk񂪕Ԃ܂B<tt class="arg">fno</tt>ɃkE|C^w肷ƁÃfBNg̃[hECfbNX擪Ɋ߂܂B܂Å֐͎Ɏ悤Ɋ֘A\IvVɂ蓮삪ς܂B</p>
-<p>hbgEGg("."A"..")́A΃pXLȂƂ(<tt>_FS_RPATH &gt;= 1</tt>)ɂ̂ݏo͂Ɍ܂B</p>
-<p>LFN@\LȎ́Å֐̌Ăяoɐ旧<tt>FILINFO</tt>\̂<tt>lfname</tt><tt>lfsize</tt>LȒlŏĂȂ΂Ȃ܂B<tt>lfname</tt>LFNi[obt@ŁA<tt>lfsize</tt>͂̃obt@̗vfłBLFNǂݏoKvȂƂ́A<tt>lfname</tt>ɃkE|C^ZbgĂB̏Ɉ‚łYꍇ́ALFNi[obt@Ƀk񂪕Ԃ܂B</p>
+<h4>解説</h4>
+<p>ディレクトリの項目(ファイルとディレクトリ)を順次読み出します。この関数を繰り返し実行することによりそのディレクトリの全ての項目を読み出すことができます。得られるファイル情報の詳細については <tt>FILINFO</tt>構造体を参照してください。全ての項目が読み出され、読み出す項目がもう無いときは、<tt>fname[]</tt>メンバにヌル文字列が返されます。<tt class="arg">fno</tt>にヌル ポインタを指定すると、そのディレクトリのリード インデックスを先頭に巻き戻します。また、この関数は次に示すように関連する構成オプションにより動作が変わります。</p>
+<p>ドット エントリ("."、"..")は、相対パスが有効なとき(<tt>_FS_RPATH &gt;= 1</tt>)にのみ出力に現れます。</p>
+<p>LFN機能が有効な時は、この関数の呼び出しに先立って<tt>FILINFO</tt>構造体の<tt>lfname</tt>と<tt>lfsize</tt>が有効な値で初期化されていなければなりません。<tt>lfname</tt>はLFNを格納するバッファで、<tt>lfsize</tt>はそのバッファの要素数です。LFNを読み出す必要がないときは、<tt>lfname</tt>にヌル ポインタをセットしてください。次の条件に一つでも該当する場合は、LFN格納バッファにヌル文字列が返されます。</p>
<ul>
-<li>fBNgڂLFN񂪑݂ȂB</li>
-<li>LFN̒ɑ΂LFNi[obt@܂LFNobt@̃TCYs\B</li>
-<li>LFNɌ݂OEMR[hɑ݂Ȃ܂܂ĂB(Unicode\̂Ƃ)</li>
+<li>ディレクトリ項目にLFN情報が存在しない。</li>
+<li>LFNの長さに対してLFN格納バッファまたはLFN操作バッファのサイズが不十分。</li>
+<li>LFNに現在のOEMコードに存在しない文字が含まれている。(非Unicode構成のとき)</li>
</ul>
-<p>܂AfBNgڂLFN񂪑݂Ȃꍇ́A<tt>fname[]</tt>ɉp܂܂ꍇ܂B</p>
+<p>また、ディレクトリ項目にLFN情報が存在しない場合は、<tt>fname[]</tt>に英小文字が含まれる場合があります。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_MINIMIZE &lt;= 1</tt>̂ƂɎgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_FS_MINIMIZE &lt;= 1</tt>のときに使用可能です。</p>
</div>
<div class="para use">
-<h4>gp</h4>
+<h4>使用例</h4>
<pre>
FRESULT scan_files (
- char* path <span class="c">/* Jnm[h ([NGAƂĂgp) */</span>
+ char* path <span class="c">/* 開始ノード (ワークエリアとしても使用) */</span>
)
{
FRESULT res;
FILINFO fno;
DIR dir;
int i;
- char *fn; <span class="c">/* Unicode\z */</span>
+ char *fn; <span class="c">/* 非Unicode構成を想定 */</span>
<span class="k">#if</span> _USE_LFN
static char lfn[_MAX_LFN + 1];
fno.lfname = lfn;
@@ -86,24 +86,24 @@ FRESULT scan_files (
<span class="k">#endif</span>
- res = f_opendir(&amp;dir, path); <span class="c">/* fBNgJ */</span>
+ res = f_opendir(&amp;dir, path); <span class="c">/* ディレクトリを開く */</span>
if (res == FR_OK) {
i = strlen(path);
for (;;) {
- res = f_readdir(&amp;dir, &amp;fno); <span class="c">/* fBNgڂ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">/* hbgGg͖ */</span>
+ res = f_readdir(&amp;dir, &amp;fno); <span class="c">/* ディレクトリ項目を1個読み出す */</span>
+ if (res != FR_OK || fno.fname[0] == 0) break; <span class="c">/* エラーまたは項目無しのときは抜ける */</span>
+ if (fno.fname[0] == '.') continue; <span class="c">/* ドットエントリは無視 */</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">/* fBNg */</span>
+ if (fno.fattrib &amp; AM_DIR) { <span class="c">/* ディレクトリ */</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>
+ if (res != FR_OK) break;
+ } else { <span class="c">/* ファイル */</span>
printf("%s/%s\n", path, fn);
}
}
@@ -117,10 +117,10 @@ FRESULT scan_files (
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</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>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/rename.html b/fatfs/doc/ja/rename.html
index 0eafa49..5259846 100644
--- a/fatfs/doc/ja/rename.html
+++ b/fatfs/doc/ja/rename.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/rename.html">
@@ -13,28 +13,28 @@
<div class="para func">
<h2>f_rename</h2>
-<p>t@C܂̓TuEfBNg̖O̕ύX܂͈ړ܂B</p>
+<p>ファイルまたはサブ ディレクトリの名前の変更または移動します。</p>
<pre>
FRESULT f_rename (
- const TCHAR* <span class="arg">old_name</span>, <span class="c">/* [IN] ÂIuWFNg */</span>
- const TCHAR* <span class="arg">new_name</span> <span class="c">/* [IN] VIuWFNg */</span>
+ const TCHAR* <span class="arg">old_name</span>, <span class="c">/* [IN] 古いオブジェクト名 */</span>
+ const TCHAR* <span class="arg">new_name</span> <span class="c">/* [IN] 新しいオブジェクト名 */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>old_name</dt>
-<dd>ύXΏۂ̃t@C܂̓TuEfBNg<a href="filename.html">pX</a>k<tt>'\0'</tt>I[̕ւ̃|C^w肵܂B</dd>
+<dd>変更対象のファイルまたはサブ ディレクトリの<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。</dd>
<dt>new_name</dt>
-<dd>VpXk<tt>'\0'</tt>I[̕ւ̃|C^w肵܂Bɑ݂IuWFNgƓO͎g܂B܂AhCuԍ͎w肵ĂA<tt class="arg">old_name</tt>Ō߂ꂽ_hCũIuWFNgƂĈ܂B</dd>
+<dd>新しいパス名を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。既に存在するオブジェクトと同じ名前は使えません。また、ドライブ番号は指定しても無視され、<tt class="arg">old_name</tt>で決められた論理ドライブ上のオブジェクトとして扱われます。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -55,28 +55,28 @@ FRESULT f_rename (
<div class="para desc">
-<h4></h4>
-<p>t@C܂̓TuEfBNg̖OύX܂B܂Aɕʂ̃fBNgւ̈ړ”\łAقȂhCuւ̈ړ͂ł܂B<em>JĂIuWFNgɑ΂ĎgpĂ͂Ȃ܂</em>B</p>
+<h4>解説</h4>
+<p>ファイルまたはサブ ディレクトリの名前を変更します。また、同時に別のディレクトリへの移動も可能ですが、異なるドライブへの移動はできません。<em>開かれているオブジェクトに対して使用してはなりません</em>。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_READONLY == 0</tt>ŁA<tt>_FS_MINIMIZE == 0</tt>̂ƂɎgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_FS_MINIMIZE == 0</tt>のときに使用可能です。</p>
</div>
<div class="para use">
-<h4>gp</h4>
+<h4>使用例</h4>
<pre>
- <span class="c">/* t@C܂̓TufBNg̖OύX */</span>
+ <span class="c">/* ファイルまたはサブディレクトリの名前を変更する */</span>
f_rename("oldname.txt", "newname.txt");
- <span class="c">/* t@C܂̓TufBNg̖O̕ύXƕʂ̃fBNgւ̈ړ */</span>
+ <span class="c">/* ファイルまたはサブディレクトリの名前の変更と別のディレクトリへの移動 */</span>
f_rename("oldname.txt", "dir1/newname.txt");
</pre>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/sdir.html b/fatfs/doc/ja/sdir.html
index 3e6f712..3390549 100644
--- a/fatfs/doc/ja/sdir.html
+++ b/fatfs/doc/ja/sdir.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/sdir.html">
@@ -13,28 +13,28 @@
<div class="para">
<h2>DIR</h2>
-<p><tt>DIR</tt>\̂́A<tt>f_opendir(), f_readdir()</tt>̃[NEGAƂĎgp܂BAvP[V́A̍\̂̃oĂ͂Ȃ܂B</p>
+<p><tt>DIR</tt>構造体は、<tt>f_opendir(), f_readdir()</tt>のワーク エリアとして使用されます。アプリケーションは、この構造体のメンバを書き換えてはなりません。</p>
<pre>
<span class="k">typedef</span> <span class="k">struct</span> {
- FATFS* fs; <span class="c">/* et@CEVXeEIuWFNgւ̃|C^ */</span>
- WORD id; <span class="c">/* et@CEVXeEIuWFNg̃}EgID */</span>
- WORD index; <span class="c">/* ɌJnfBNgECfbNXԍ */</span>
- DWORD sclust; <span class="c">/* e[uJnNX^ (0:[g) */</span>
- DWORD clust; <span class="c">/* ݂̃NX^ԍ */</span>
- DWORD sect; <span class="c">/* ݂̃ZN^ԍ */</span>
- BYTE* dir; <span class="c">/* ݂SFNGgւ̃|C^ */</span>
- BYTE* fn; <span class="c">/* SFNobt@ւ̃|C^ (in/out) {file[8],ext[3],status[1]} */</span>
+ FATFS* fs; <span class="c">/* 親ファイル システム オブジェクトへのポインタ */</span>
+ WORD id; <span class="c">/* 親ファイル システム オブジェクトのマウントID */</span>
+ WORD index; <span class="c">/* 次に検索開始するディレクトリ インデックス番号 */</span>
+ DWORD sclust; <span class="c">/* テーブル開始クラスタ (0:ルート) */</span>
+ DWORD clust; <span class="c">/* 現在のクラスタ番号 */</span>
+ DWORD sect; <span class="c">/* 現在のセクタ番号 */</span>
+ BYTE* dir; <span class="c">/* 現在のSFNエントリへのポインタ */</span>
+ BYTE* fn; <span class="c">/* SFNバッファへのポインタ (in/out) {file[8],ext[3],status[1]} */</span>
<span class="k">#if</span> _FS_LOCK
- UINT lockid; <span class="c">/* bNID */</span>
+ UINT lockid; <span class="c">/* ロックID */</span>
<span class="k">#endif</span>
<span class="k">#if</span> _USE_LFN
- WCHAR* lfn; <span class="c">/* LFNobt@ւ̃|C^ (in/out) */</span>
- WORD lfn_idx; <span class="c">/* LFNGg̐擪CfbNX (0xFFFF:) */</span>
+ WCHAR* lfn; <span class="c">/* LFNバッファへのポインタ (in/out) */</span>
+ WORD lfn_idx; <span class="c">/* LFNエントリの先頭インデックス (0xFFFF:無効) */</span>
<span class="k">#endif</span>
} DIR;
</pre>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/setlabel.html b/fatfs/doc/ja/setlabel.html
index af4a243..dc71ac3 100644
--- a/fatfs/doc/ja/setlabel.html
+++ b/fatfs/doc/ja/setlabel.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/setlabel.html">
@@ -13,25 +13,25 @@
<div class="para func">
<h2>f_setlabel</h2>
-<p>{[Ƀ{[Exݒ肵܂B</p>
+<p>ボリュームにボリューム ラベルを設定します。</p>
<pre>
FRESULT f_setlabel (
- const TCHAR* <span class="arg">label</span> <span class="c">/* [IN] ݒ肷{[Exւ̃|C^ */</span>
+ const TCHAR* <span class="arg">label</span> <span class="c">/* [IN] 設定するボリューム ラベルへのポインタ */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>label</dt>
-<dd>ݒ肷{[Exk<tt>'\0'</tt>I[̕ւ̃|C^w肵܂B</dd>
+<dd>設定するボリューム ラベルを示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -48,42 +48,42 @@ FRESULT f_setlabel (
<div class="para desc">
-<h4></h4>
-<p>̐擪ɃhCuԍ܂ޏꍇ́A̘_hCuɑ΂Đݒ肳܂B܂܂Ȃꍇ́AftHgEhCuɐݒ肳܂B{[Ex폜Ƃ́Akw肵܂B{[Ex̃tH[}bǵAt@C(SFN)ƂقړłA̓_قȂ܂B</p>
+<h4>解説</h4>
+<p>文字列の先頭にドライブ番号を含む場合は、その論理ドライブに対して設定されます。含まない場合は、デフォルト ドライブに設定されます。ボリューム ラベルを削除するときは、ヌル文字列を指定します。ボリューム ラベルのフォーマットは、ファイル名(SFN)とほぼ同じですが、次の点が異なります。</p>
<ul>
-<li>[JR[hZ11oCgȉBLFNg͓Kp܂B</li>
-<li>sIh܂ނƂ͂łȂB</li>
-<li>Cӂ̈ʒuɃXy[XuƂłBAŌƂȂXy[X͏B</li>
+<li>ローカル文字コード換算で11バイト以下。LFN拡張は適用されません。</li>
+<li>ピリオドを含むことはできない。</li>
+<li>任意の位置にスペースを置くことができる。ただし、最後尾となるスペースは除去される。</li>
</ul>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_READONLY == 0</tt>ŁA<tt>_USE_LABEL == 1</tt>̂ƂɎgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_USE_LABEL == 1</tt>のときに使用可能です。</p>
</div>
<div class="para use">
-<h4>gp</h4>
+<h4>使用例</h4>
<pre>
- <span class="c">/* ftHgEhCuɃ{[Exݒ */</span>
+ <span class="c">/* デフォルト ドライブにボリューム ラベルを設定 */</span>
f_setlabel("DATA DISK");
- <span class="c">/* hCu2Ƀ{[Exݒ */</span>
+ <span class="c">/* ドライブ2にボリューム ラベルを設定 */</span>
f_setlabel("2:DISK 3 OF 4");
- <span class="c">/* hCu2̃{[Ex폜 */</span>
+ <span class="c">/* ドライブ2のボリューム ラベルを削除 */</span>
f_setlabel("2:");
</pre>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<tt><a href="getlabel.html">f_getlabel</a></tt>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/sfatfs.html b/fatfs/doc/ja/sfatfs.html
index ed5ac87..93b9e7c 100644
--- a/fatfs/doc/ja/sfatfs.html
+++ b/fatfs/doc/ja/sfatfs.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/sfatfs.html">
@@ -13,43 +13,43 @@
<div class="para">
<h2>FATFS</h2>
-<p><tt>FATFS</tt>\(t@CEVXeEIuWFNg)́AX̘_hCũ_Ci~bNE[NEGAێA<tt>f_mount()</tt>FatFsW[ɓo^܂Bs^C~ÓA<tt>f_mount()</tt>(}Egw)̎s܂̓fBǍ̍ŏ̃t@CEANZX̎łBAvP[V́A̍\̂̃oĂ͂Ȃ܂B</p>
+<p><tt>FATFS</tt>構造体(ファイル システム オブジェクト)は、個々の論理ドライブのダイナミック ワーク エリアを保持し、<tt>f_mount()</tt>でFatFsモジュールに登録されます。初期化が行われるタイミングは、<tt>f_mount()</tt>(強制マウント指定)の実行またはメディア交換の後の最初のファイル アクセスの時です。アプリケーションは、この構造体のメンバを書き換えてはなりません。</p>
<pre>
<span class="k">typedef</span> <span class="k">struct</span> {
- BYTE fs_type; <span class="c">/* FAT^Cv */</span>
- BYTE drv; <span class="c">/* hCuԍ */</span>
- BYTE csize; <span class="c">/* NX^̃ZN^ (1,2,4,8,...,128)*/</span>
- BYTE n_fats; <span class="c">/* FAT̑d (1,2) */</span>
- BYTE wflag; <span class="c">/* win[]_[eBEtO */</span>
- BYTE fsi_flag; <span class="c">/* FSINFOtO (b7:Disabled, b0:Dirty)*/</span>
- WORD id; <span class="c">/* t@CEVXeE}EgID */</span>
- WORD n_rootdir; <span class="c">/* [gEfBNg̃Gg (FAT12/16) */</span>
+ BYTE fs_type; <span class="c">/* FATタイプ */</span>
+ BYTE drv; <span class="c">/* 物理ドライブ番号 */</span>
+ BYTE csize; <span class="c">/* クラスタ当たりのセクタ数 (1,2,4,8,...,128)*/</span>
+ BYTE n_fats; <span class="c">/* FATの多重化数 (1,2) */</span>
+ BYTE wflag; <span class="c">/* win[]ダーティ フラグ */</span>
+ BYTE fsi_flag; <span class="c">/* FSINFOフラグ (b7:Disabled, b0:Dirty)*/</span>
+ WORD id; <span class="c">/* ファイル システム マウントID */</span>
+ WORD n_rootdir; <span class="c">/* ルート ディレクトリのエントリ数 (FAT12/16) */</span>
<span class="k">#if</span> _MAX_SS != _MIN_SS
- WORD ssize; <span class="c">/* ZN^ETCY (512, 1024, 2048 or 4096) */</span>
+ WORD ssize; <span class="c">/* セクタ サイズ (512, 1024, 2048 or 4096) */</span>
<span class="k">#endif</span>
<span class="k">#if</span> _FS_REENTRANT
- _SYNC_t sobj; <span class="c">/* IuWFNgID */</span>
+ _SYNC_t sobj; <span class="c">/* 同期オブジェクトID */</span>
<span class="k">#endif</span>
<span class="k">#if</span> !_FS_READONLY
- DWORD last_clust; <span class="c">/* FSINFO: ŌɊ蓖ĂꂽNX^ԍ */</span>
- DWORD free_clust; <span class="c">/* FSINFO: 󂫃NX^ */</span>
+ DWORD last_clust; <span class="c">/* FSINFO: 最後に割り当てられたクラスタ番号 */</span>
+ DWORD free_clust; <span class="c">/* FSINFO: 空きクラスタ数 */</span>
<span class="k">#endif</span>
<span class="k">#if</span> _FS_RPATH
- DWORD cdir; <span class="c">/* JgEfBNg̃NX^ (0:[g) */</span>
+ DWORD cdir; <span class="c">/* カレント ディレクトリのクラスタ (0:ルート) */</span>
<span class="k">#endif</span>
- DWORD n_fatent; <span class="c">/* FATGg (NX^ + 2) */</span>
- DWORD fsize; <span class="c">/* FAT 1‚̃ZN^ */</span>
- DWORD volbase; <span class="c">/* {[JnZN^ */</span>
- DWORD fatbase; <span class="c">/* FAT̈JnZN^ */</span>
- DWORD dirbase; <span class="c">/* [gEfBNg̈JnZN^(NX^) */</span>
- DWORD database; <span class="c">/* f[^̈JnZN^ */</span>
- DWORD winsect; <span class="c">/* win[]ɌĂZN^ԍ */</span>
- BYTE win[_MAX_SS]; <span class="c">/* fBXNEANZXEEBhE */</span>
+ DWORD n_fatent; <span class="c">/* FATエントリ数 (総クラスタ数 + 2) */</span>
+ DWORD fsize; <span class="c">/* FAT 1個のセクタ数 */</span>
+ DWORD volbase; <span class="c">/* ボリューム開始セクタ */</span>
+ DWORD fatbase; <span class="c">/* FAT領域開始セクタ */</span>
+ DWORD dirbase; <span class="c">/* ルート ディレクトリ領域開始セクタ(クラスタ) */</span>
+ DWORD database; <span class="c">/* データ領域開始セクタ */</span>
+ DWORD winsect; <span class="c">/* win[]に現れているセクタ番号 */</span>
+ BYTE win[_MAX_SS]; <span class="c">/* ディスク アクセス ウィンドウ */</span>
} FATFS;
</pre>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/sfile.html b/fatfs/doc/ja/sfile.html
index 36a73b3..5da60f9 100644
--- a/fatfs/doc/ja/sfile.html
+++ b/fatfs/doc/ja/sfile.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/sfile.html">
@@ -13,36 +13,36 @@
<div class="para">
<h2>FIL</h2>
-<p><tt>FIL</tt>\(t@CEIuWFNg)́A<tt>f_open()</tt>ŏAȌセ̃t@C̏Ԃێ܂B܂A<tt>f_close()</tt>Ńt@C‚Ɩ܂BAvP[V́A̍\̂̃oĂ͂Ȃ܂(<tt>cltbl</tt>͗O)B^Cj[\ł́AɃZN^Eobt@mۂ̂ŁALTCYɒӂKvłB</p>
+<p><tt>FIL</tt>構造体(ファイル オブジェクト)は、<tt>f_open()</tt>で初期化され、以後そのファイルの状態を保持します。また、<tt>f_close()</tt>でファイルが閉じられると無効化されます。アプリケーションは、この構造体のメンバを書き換えてはなりません(<tt>cltbl</tt>は例外)。非タイニー構成(<tt>_FS_TINY == 0</tt>)では、内部に<tt>_MAX_SS</tt>バイトのセクタ バッファが確保されるので、そのサイズには注意が必要です。</p>
<pre>
<span class="k">typedef</span> <span class="k">struct</span> {
- FATFS* fs; <span class="c">/* et@CEVXeEIuWFNgւ̃|C^ */</span>
- WORD id; <span class="c">/* et@CEVXeEIuWFNg̃}EgID */</span>
- BYTE flag; <span class="c">/* t@CEXe[^XEtO */</span>
- BYTE err; <span class="c">/* G[ftO */</span>
- DWORD fptr; <span class="c">/* t@Cǂݏ|C^ (t@C擪̃oCgEItZbg) */</span>
- DWORD fsize; <span class="c">/* t@CETCY(oCgP) */</span>
- DWORD sclust; <span class="c">/* t@CJnNX^ԍ (0:蓖Ė) */</span>
- DWORD clust; <span class="c">/* ݂̃NX^ */</span>
- DWORD dsect; <span class="c">/* ݂̃f[^EZN^ */</span>
+ FATFS* fs; <span class="c">/* 親ファイル システム オブジェクトへのポインタ */</span>
+ WORD id; <span class="c">/* 親ファイル システム オブジェクトのマウントID */</span>
+ BYTE flag; <span class="c">/* ファイル ステータス フラグ */</span>
+ BYTE err; <span class="c">/* エラー中断フラグ */</span>
+ DWORD fptr; <span class="c">/* ファイル読み書きポインタ (ファイル先頭からのバイト オフセット) */</span>
+ DWORD fsize; <span class="c">/* ファイル サイズ(バイト単位) */</span>
+ DWORD sclust; <span class="c">/* ファイル開始クラスタ番号 (0:割り当て無し) */</span>
+ DWORD clust; <span class="c">/* 現在のクラスタ */</span>
+ DWORD dsect; <span class="c">/* 現在のデータ セクタ */</span>
<span class="k">#if</span> !_FS_READONLY
- DWORD dir_sect; <span class="c">/* ̃t@C̃fBNgEGĝZN^ */</span>
- BYTE* dir_ptr; <span class="c">/* ̃t@C̃fBNgւ̃|C^ */</span>
+ DWORD dir_sect; <span class="c">/* このファイルのディレクトリ エントリのあるセクタ */</span>
+ BYTE* dir_ptr; <span class="c">/* このファイルのディレクトリへのポインタ */</span>
<span class="k">#endif</span>
<span class="k">#if</span> _USE_FASTSEEK
- DWORD* cltbl; <span class="c">/* t@C̃NX^ENւ̃|C^ (I[vNULLZbg) */</span>
+ DWORD* cltbl; <span class="c">/* ファイルのクラスタ リンク情報へのポインタ (オープン時にNULLがセットされる) */</span>
<span class="k">#endif</span>
<span class="k">#if</span> _FS_LOCK
- UINT lockid; <span class="c">/* t@CEbNID */</span>
+ UINT lockid; <span class="c">/* ファイル ロックID */</span>
<span class="k">#endif</span>
<span class="k">#if</span> !_FS_TINY
- BYTE buf[_MAX_SS]; <span class="c">/* t@CEvCx[gEf[^]obt@ */</span>
+ BYTE buf[_MAX_SS]; <span class="c">/* ファイル プライベート データ転送バッファ */</span>
<span class="k">#endif</span>
} FIL;
</pre>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/sfileinfo.html b/fatfs/doc/ja/sfileinfo.html
index 1a3db24..a9167f1 100644
--- a/fatfs/doc/ja/sfileinfo.html
+++ b/fatfs/doc/ja/sfileinfo.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/sfileinfo.html">
@@ -13,58 +13,58 @@
<div class="para">
<h2>FILINFO</h2>
-<p><tt>FILINFO</tt>\̂́A<tt>f_stat(), f_readdir()</tt>ŕԂt@Cێ܂B</p>
+<p><tt>FILINFO</tt>構造体は、<tt>f_stat(), f_readdir()</tt>で返されるファイル情報を保持します。</p>
<pre>
<span class="k">typedef</span> <span class="k">struct</span> {
- DWORD fsize; <span class="c">/* t@CETCY */</span>
- WORD fdate; <span class="c">/* ŌɍXVꂽt */</span>
- WORD ftime; <span class="c">/* ŌɍXVꂽ */</span>
- BYTE fattrib; <span class="c">/* Agr[g */</span>
- TCHAR fname[13]; <span class="c">/* Zt@C (8.3tH[}bg) */</span>
+ DWORD fsize; <span class="c">/* ファイル サイズ */</span>
+ WORD fdate; <span class="c">/* 最後に更新された日付 */</span>
+ WORD ftime; <span class="c">/* 最後に更新された時刻 */</span>
+ BYTE fattrib; <span class="c">/* アトリビュート */</span>
+ TCHAR fname[13]; <span class="c">/* 短いファイル名 (8.3フォーマット) */</span>
<span class="k">#if</span> _USE_LFN
- TCHAR* lfname; <span class="c">/* t@C̃obt@ւ̃|C^ */</span>
- int lfsize; <span class="c">/* t@C̃obt@̃TCY [] */</span>
+ TCHAR* lfname; <span class="c">/* 長いファイル名のバッファへのポインタ */</span>
+ int lfsize; <span class="c">/* 長いファイル名のバッファのサイズ [文字数] */</span>
<span class="k">#endif</span>
} FILINFO;
</pre>
</div>
-<h4>o</h4>
+<h4>メンバ</h4>
<dl>
<dt>fsize</dt>
-<dd>t@C̃oCgPʂ̃TCYi[܂BfBNg̏ꍇ͏0łB</dd>
+<dd>ファイルのバイト単位のサイズが格納されます。ディレクトリの場合は常に0です。</dd>
<dt>fdate</dt>
-<dd>t@C̕ύXꂽtA܂̓fBNg̍쐬ꂽti[܂B<br>
+<dd>ファイルの変更された日付、またはディレクトリの作成された日付が格納されます。<br>
<dl>
<dt>bit15:9</dt>
-<dd>1980NN_ƂN 0..127 œ܂B</dd>
+<dd>1980年を起点とした年が 0..127 で入ります。</dd>
<dt>bit8:5</dt>
-<dd> 1..12 ̒lœ܂B</dd>
+<dd>月が 1..12 の値で入ります。</dd>
<dt>bit4:0</dt>
-<dd> 1..31 ̒lœ܂B</dd>
+<dd>日が 1..31 の値で入ります。</dd>
</dl>
</dd>
<dt>ftime</dt>
-<dd>t@C̕ύXꂽA܂̓fBNg̍쐬ꂽi[܂B<br>
+<dd>ファイルの変更された時刻、またはディレクトリの作成された時刻が格納されます。<br>
<dl>
<dt>bit15:11</dt>
-<dd> 0..23 ̒lœ܂B</dd>
+<dd>時が 0..23 の値で入ります。</dd>
<dt>bit10:5</dt>
-<dd> 0..59 ̒lœ܂B</dd>
+<dd>分が 0..59 の値で入ります。</dd>
<dt>bit4:0</dt>
-<dd>b/2 0..29 ̒lœ܂B</dd>
+<dd>秒/2が 0..29 の値で入ります。</dd>
</dl>
</dd>
<dt>fattrib</dt>
-<dd>tOi[܂BtO<tt>AM_DIR, AM_RDO, AM_HID, AM_SYS, AM_ARC</tt>̑gݍ킹ƂȂ܂B</dd>
+<dd>属性フラグが格納されます。フラグは<tt>AM_DIR, AM_RDO, AM_HID, AM_SYS, AM_ARC</tt>の組み合わせとなります。</dd>
<dt>fname[]</dt>
-<dd>8.3`̖O<tt>'\0'</tt>ŏI镶ƂĊi[܂BLFN\̂Ƃ́Aɑ啶ŕԂ܂BLFN\̂Ƃ͒ZOԂ܂AASCIIpɂȂꍇ܂B</dd>
+<dd>8.3形式の名前が<tt>'\0'</tt>で終わる文字列として格納されます。非LFN構成のときは、常に大文字で返されます。LFN構成のときは短い名前が返されますが、ASCII英字が小文字になる場合があります。</dd>
<dt>lfname</dt>
-<dd>Ԃ钷t@Ci[obt@ւ̃|C^B̍\̂gpOɃAvP[Vɂ菉Ȃ΂Ȃ܂B̃oNULLݒ肳LFN͕Ԃ܂BLFN\̂Ƃ͂̃o݂͑܂B</dd>
+<dd>返される長いファイル名を格納するバッファへのポインタ。この構造体を使用する前にアプリケーションにより初期化されなければなりません。このメンバにNULLが設定されるとLFNは返されません。非LFN構成のときはこのメンバは存在しません。</dd>
<dt>lfsize</dt>
-<dd>t@Ci[obt@̃TCY(vf)B̍\̂gpOɃAvP[Vɂ菉Ȃ΂Ȃ܂BLFN\̂Ƃ͂̃o݂͑܂B</dd>
+<dd>長いファイル名を格納するバッファのサイズ(要素数)。この構造体を使用する前にアプリケーションにより初期化されなければなりません。非LFN構成のときはこのメンバは存在しません。</dd>
</dl>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/size.html b/fatfs/doc/ja/size.html
index caff05d..d75ffc3 100644
--- a/fatfs/doc/ja/size.html
+++ b/fatfs/doc/ja/size.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/size.html">
@@ -13,33 +13,33 @@
<div class="para func">
<h2>f_size</h2>
-<p>t@C̃TCY擾܂B</p>
+<p>ファイルのサイズを取得します。</p>
<pre>
DWORD f_size (
- FIL* <span class="arg">fp</span> <span class="c">/* [IN] t@CEIuWFNg */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル オブジェクト */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>fp</dt>
-<dd>t@CEIuWFNg\̂ւ̃|C^w肵܂B</dd>
+<dd>ファイル オブジェクト構造体へのポインタを指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
-<p>oCgPʂ̃t@CETCYԂ܂B</p>
+<h4>戻り値</h4>
+<p>バイト単位のファイル サイズが返ります。</p>
</div>
<div class="para desc">
-<h4></h4>
-<p>f_size֐́ArWł̓}NƂĎĂ܂B</p>
+<h4>解説</h4>
+<p>f_size関数は、現リビジョンではマクロとして実装されています。</p>
<pre>
<span class="k">#define</span> f_size(fp) ((fp)->fsize)
</pre>
@@ -47,16 +47,16 @@ DWORD f_size (
<div class="para comp">
-<h4>Ή</h4>
-<p>Ɏgp”\B</p>
+<h4>対応情報</h4>
+<p>常に使用可能。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/stat.html b/fatfs/doc/ja/stat.html
index 5337f34..724a9d5 100644
--- a/fatfs/doc/ja/stat.html
+++ b/fatfs/doc/ja/stat.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/stat.html">
@@ -13,28 +13,28 @@
<div class="para func">
<h2>f_stat</h2>
-<p>t@C܂̓TuEfBNg݂̑𒲂ׁA܂̏擾܂B</p>
+<p>ファイルまたはサブ ディレクトリの存在を調べ、またその情報を取得します。</p>
<pre>
FRESULT f_stat (
- const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] IuWFNgւ̃|C^ */</span>
- FILINFO* <span class="arg">fno</span> <span class="c">/* [OUT] t@C\̂ւ̃|C^ */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] オブジェクト名へのポインタ */</span>
+ FILINFO* <span class="arg">fno</span> <span class="c">/* [OUT] ファイル情報構造体へのポインタ */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>path</dt>
-<dd>`FbNIuWFNgk<tt>'\0'</tt>I[̕w|C^w肵܂B</dd>
+<dd>チェックするオブジェクト名を示すヌル文字<tt>'\0'</tt>終端の文字列を指すポインタを指定します。</dd>
<dt>fno</dt>
-<dd>IuWFNg݂Ƃɂ̏i[t@C\̂ւ̃|C^w肵܂B̏񂪕svȂƂ̓kE|C^w肵ĂB</dd>
+<dd>オブジェクトが存在したときにその情報を格納するファイル情報構造体へのポインタを指定します。この情報が不要なときはヌル ポインタを指定してください。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -53,22 +53,61 @@ FRESULT f_stat (
<div class="para desc">
-<h4></h4>
-<p>w肳ꂽt@C܂̓TuEfBNg݂̑𒲂ׂ܂B݂Ȃꍇ́A<tt>FR_NO_FILE</tt>A܂B݂ꍇ<tt>FR_OK</tt>AAt@C\̂ɂւ(TCYA^CX^vAђZt@C)XgA܂B</p>
+<h4>解説</h4>
+<p>指定されたファイルまたはサブ ディレクトリの存在を調べます。存在しない場合は、<tt>FR_NO_FILE</tt>が帰ります。存在する場合は<tt>FR_OK</tt>が帰り、ファイル情報構造体にそれ関する情報(サイズ、タイムスタンプ、属性および短いファイル名)がストアされます。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_MINIMIZE == 0</tt>̂ƂɎgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_FS_MINIMIZE == 0</tt>のときに使用可能です。</p>
+</div>
+
+
+<div class="para use">
+<h4>使用例</h4>
+<pre>
+ FRESULT fr;
+ FILINFO fno;
+
+
+ printf("Test for 'file.txt'...\n");
+
+<span class="k">#if</span> _USE_LFN
+ fno.lfname = 0;
+<span class="k">#endif</span>
+ fr = f_stat("file.txt", &amp;fno);
+ switch (fr) {
+
+ case FR_OK:
+ printf("Size: %u\n", fno.fsize);
+ printf("Timestamp: %u/%02u/%02u, %02u:%02u\n",
+ (fno.fdate &gt;&gt; 9) + 1980, fno.fdate &gt;&gt; 5 &amp; 15, fno.fdate &amp; 31,
+ fno.ftime &gt;&gt; 11, fno.ftime &gt;&gt; 5 &amp; 63);
+ printf("Attributes: %c%c%c%c%c\n",
+ (fno.fattrib & AM_DIR) ? 'D' : '-',
+ (fno.fattrib & AM_RDO) ? 'R' : '-',
+ (fno.fattrib & AM_HID) ? 'H' : '-',
+ (fno.fattrib & AM_SYS) ? 'S' : '-',
+ (fno.fattrib & AM_ARC) ? 'A' : '-');
+ break;
+
+ case FR_NO_FILE:
+ printf("It is not exist.\n");
+ break;
+
+ default:
+ printf("An error occured. (%d)\n", fr);
+ }
+</pre>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="opendir.html">f_opendir</a>, <a href="readdir.html">f_readdir</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>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/sync.html b/fatfs/doc/ja/sync.html
index 74f7910..4b594d6 100644
--- a/fatfs/doc/ja/sync.html
+++ b/fatfs/doc/ja/sync.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/sync.html">
@@ -13,25 +13,25 @@
<div class="para func">
<h2>f_sync</h2>
-<p>ݒ̃t@C̃LbVꂽtbV܂B</p>
+<p>書き込み中のファイルのキャッシュされた情報をフラッシュします。</p>
<pre>
FRESULT f_sync (
- FIL* <span class="arg">fp</span> <span class="c">/* [IN] t@CEIuWFNg\̂ւ̃|C^ */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル オブジェクト構造体へのポインタ */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>fp</dt>
-<dd>synct@C̃t@CEIuWFNg\̂ւ̃|C^w肵܂B</dd>
+<dd>syncするファイルのファイル オブジェクト構造体へのポインタを指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -44,23 +44,23 @@ FRESULT f_sync (
<div class="para desc">
-<h4></h4>
-<p>̊֐<tt>f_close()</tt>Ɠs܂At@C͈Jꂽ܂܂ɂȂAǂݏ𑱍sł܂BMOȂǁA݃[hŒԃt@CJĂAvP[VɂāAI܂͋؂̗ǂƂł̊֐gp邱ƂɂAsӂ̓df⃁fBA̎Oɂ莸f[^ŏɂ邱Ƃł܂B̔wiɂ‚ẮA<a href="appnote.html#critical">AvP[VEm[g</a>QƂĂB</p>
-<p>ۂ̂ƂA<tt>f_close()</tt>ł͂̊֐Ăяot@CEIuWFNg𖳌Ă邾Ȃ̂ŁA<tt>f_close()</tt>O<tt>f_sync()</tt>uƂ͖ӖłB</p>
+<h4>解説</h4>
+<p>この関数は<tt>f_close()</tt>と同じ処理を実行しますが、ファイルは引き続き開かれたままになり、読み書きを続行できます。ロギングなど、書き込みモードで長時間ファイルが開かれているアプリケーションにおいて、定期的または区切りの良いところでこの関数を使用することにより、不意の電源断やメディアの取り外しにより失われるデータを最小にすることができます。この背景については、<a href="appnote.html#critical">アプリケーション ノート</a>も参照してください。</p>
+<p>実際のところ、<tt>f_close()</tt>内ではこの関数を呼び出した後ファイル オブジェクトを無効化しているだけなので、<tt>f_close()</tt>直前に<tt>f_sync()</tt>を置くことは無意味です。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_READONLY == 0</tt>̂ƂɎgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_FS_READONLY == 0</tt>のときに使用可能です。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="close.html">f_close</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/tell.html b/fatfs/doc/ja/tell.html
index 1dee982..d050691 100644
--- a/fatfs/doc/ja/tell.html
+++ b/fatfs/doc/ja/tell.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="up" title="FatFs" href="../00index_e.html">
<link rel="alternate" hreflang="en" title="English" href="../en/tell.html">
@@ -13,33 +13,33 @@
<div class="para func">
<h2>f_tell</h2>
-<p>݂̃[h/CgE|C^擾܂B</p>
+<p>現在のリード/ライト ポインタを取得します。</p>
<pre>
DWORD f_tell (
- FIL* <span class="arg">fp</span> <span class="c">/* [IN] t@CEIuWFNg */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル オブジェクト */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>fp</dt>
-<dd>t@CEIuWFNg\̂ւ̃|C^w肵܂B</dd>
+<dd>ファイル オブジェクト構造体へのポインタを指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
-<p>݂̃[h/CgE|C^(t@C擪̃oCgPʂ̃ItZbg)Ԃ܂B</p>
+<h4>戻り値</h4>
+<p>現在のリード/ライト ポインタ(ファイル先頭からのバイト単位のオフセット)が返ります。</p>
</div>
<div class="para desc">
-<h4></h4>
-<p>f_tell֐́ArWł̓}NƂĎĂ܂B</p>
+<h4>解説</h4>
+<p>f_tell関数は、現リビジョンではマクロとして実装されています。</p>
<pre>
<span class="k">#define</span> f_tell(fp) ((fp)->fptr)
</pre>
@@ -47,16 +47,16 @@ DWORD f_tell (
<div class="para comp">
-<h4>Ή</h4>
-<p>Ɏgp”\B</p>
+<h4>対応情報</h4>
+<p>常に使用可能。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/truncate.html b/fatfs/doc/ja/truncate.html
index 29bf480..b33a757 100644
--- a/fatfs/doc/ja/truncate.html
+++ b/fatfs/doc/ja/truncate.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/truncate.html">
@@ -13,25 +13,25 @@
<div class="para func">
<h2>f_truncate</h2>
-<p>t@C؂l߂܂B</p>
+<p>ファイル長を切り詰めます。</p>
<pre>
FRESULT f_truncate (
- FIL* <span class="arg">fp</span> <span class="c">/* [IN] t@CEIuWFNgւ̃|C^ */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル オブジェクトへのポインタ */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>fp</dt>
-<dd>؂lߑΏۃt@C̃t@CEIuWFNgւ̃|C^</dd>
+<dd>切り詰め対象ファイルのファイル オブジェクトへのポインタ</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -45,19 +45,19 @@ FRESULT f_truncate (
<div class="para desc">
-<h4></h4>
-<p>t@C݂̒̃[h/CgE|C^ɐ؂l߂܂B[h/CgE|C^Ƀt@C̏I[wĂƂ́Å֐͉̌ʂ܂B</p>
+<h4>解説</h4>
+<p>ファイルの長さが現在のリード/ライト ポインタに切り詰められます。リード/ライト ポインタが既にファイルの終端を指しているときは、この関数は何の効果も持ちません。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_READONLY == 0</tt>ŁA<tt>_FS_MINIMIZE == 0</tt>̂ƂɎgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_FS_MINIMIZE == 0</tt>のときに使用可能です。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/fatfs/doc/ja/unlink.html b/fatfs/doc/ja/unlink.html
index 7cfb703..3ae691a 100644
--- a/fatfs/doc/ja/unlink.html
+++ b/fatfs/doc/ja/unlink.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/unlink.html">
@@ -13,25 +13,25 @@
<div class="para func">
<h2>f_unlink</h2>
-<p>t@C܂̓TuEfBNg폜܂B</p>
+<p>ファイルまたはサブ ディレクトリを削除します。</p>
<pre>
FRESULT f_unlink (
- const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] IuWFNgւ̃|C^ */</span>
+ const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] オブジェクト名へのポインタ */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>path</dt>
-<dd>폜Ώۂ<a href="filename.html">pX</a>k<tt>'\0'</tt>I[̕ւ̃|C^w肵܂B</dd>
+<dd>削除対象の<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -53,22 +53,22 @@ FRESULT f_unlink (
<div class="para desc">
-<h4></h4>
-<p>폜Ώۂ̃IuWFNg̏ɓĂ͂܂ꍇÃANZX͋ۂ֐͎s܂B
+<h4>解説</h4>
+<p>削除対象のオブジェクトが次の条件に当てはまる場合、そのアクセスは拒否され関数は失敗します。
<ul>
-<li>[hEI[(<tt>AM_RDO</tt>)Ăꍇ́A(<tt>FR_DENIED</tt>)B</li>
-<li>łȂTuEfBNg܂̓JgEfBNgłꍇ́A(<tt>FR_DENIED</tt>)B</li>
-<li>JĂt@C܂̓TuEfBNgłꍇ́A<a href="appnote.html#dup">dANZX</a>LȂSɋ(<tt>FR_LOCKED</tt>)܂AłȂƂ͕sȑƂȂA<em>FAT\j󂳂”\</em>܂B</li>
+<li>リード オンリー属性(<tt>AM_RDO</tt>)を持っている場合は、拒否(<tt>FR_DENIED</tt>)される。</li>
+<li>空でないサブ ディレクトリまたはカレント ディレクトリである場合は、拒否(<tt>FR_DENIED</tt>)される。</li>
+<li>開かれているファイルまたはサブ ディレクトリである場合は、<a href="appnote.html#dup">多重アクセス制御</a>が有効なら安全に拒否(<tt>FR_LOCKED</tt>)されますが、そうでないときは不正な操作となり、<em>FAT構造が破壊される可能性</em>があります。</li>
</ul>
</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_READONLY == 0</tt>ŁA<tt>_FS_MINIMIZE == 0</tt>̂ƂɎgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_FS_MINIMIZE == 0</tt>のときに使用可能です。</p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/utime.html b/fatfs/doc/ja/utime.html
index 382defb..087f57f 100644
--- a/fatfs/doc/ja/utime.html
+++ b/fatfs/doc/ja/utime.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/utime.html">
@@ -13,28 +13,28 @@
<div class="para func">
<h2>f_utime</h2>
-<p>t@C܂̓TuEfBNg̃^CX^vύX܂B</p>
+<p>ファイルまたはサブ ディレクトリのタイムスタンプを変更します。</p>
<pre>
FRESULT f_utime (
- const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] IuWFNgւ̃|C^ */</span>
- const FILINFO* <span class="arg">fno</span> <span class="c">/* [IN] ݒ肷t */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] オブジェクト名へのポインタ */</span>
+ const FILINFO* <span class="arg">fno</span> <span class="c">/* [IN] 設定する日付 */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>path</dt>
-<dd>ύXΏۂ̃IuWFNg<a href="filename.html">pX</a>k<tt>'\0'</tt>I[̕w肵܂B</dd>
+<dd>変更対象のオブジェクトの<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列を指定します。</dd>
<dt>fno</dt>
-<dd>ݒ肷tƎԂ<tt>fdate</tt><tt>ftime</tt>oɐݒ肳ꂽ<tt>FILINFO</tt>\̂ւ̃|C^B̃o͂̊֐ł͈Ӗ܂B</dd>
+<dd>設定する日付と時間を<tt>fdate</tt>と<tt>ftime</tt>メンバに設定された<tt>FILINFO</tt>構造体へのポインタ。他のメンバはこの関数では意味を持ちません。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -54,16 +54,16 @@ FRESULT f_utime (
<div class="para desc">
-<h4></h4>
-<p>IuWFNg̃^CX^vύX܂B</p>
+<h4>解説</h4>
+<p>オブジェクトのタイムスタンプを変更します。</p>
</div>
<div class="para use">
-<h4>gp</h4>
+<h4>使用例</h4>
<pre>
FRESULT set_timestamp (
- char *obj, <span class="c">/* t@Cւ̃|C^ */</span>
+ char *obj, <span class="c">/* ファイル名へのポインタ */</span>
int year,
int month,
int mday,
@@ -84,16 +84,16 @@ FRESULT set_timestamp (
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_READONLY == 0</tt>ŁA<tt>_FS_MINIMIZE == 0</tt>̂ƂɎgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_FS_MINIMIZE == 0</tt>のときに使用可能です。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="stat.html">f_stat</a>, <a href="sfileinfo.html">FILINFO</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/ja/write.html b/fatfs/doc/ja/write.html
index 35da3fa..c3de4a0 100644
--- a/fatfs/doc/ja/write.html
+++ b/fatfs/doc/ja/write.html
@@ -1,7 +1,7 @@
<!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-Type" content="text/html; charset=utf-8">
<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/write.html">
@@ -13,34 +13,34 @@
<div class="para func">
<h2>f_write</h2>
-<p>t@CɃf[^݂܂B</p>
+<p>ファイルにデータを書き込みます。</p>
<pre>
FRESULT f_write (
- FIL* <span class="arg">fp</span>, <span class="c">/* [IN] t@CEIuWFNg */</span>
- const void* <span class="arg">buff</span>, <span class="c">/* [IN] ݃f[^ */</span>
- UINT <span class="arg">btw</span>, <span class="c">/* [IN] ރoCg */</span>
- UINT* <span class="arg">bw</span> <span class="c">/* [OUT] ܂ꂽoCg */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [IN] ファイル オブジェクト */</span>
+ const void* <span class="arg">buff</span>, <span class="c">/* [IN] 書き込みデータ */</span>
+ UINT <span class="arg">btw</span>, <span class="c">/* [IN] 書き込むバイト数 */</span>
+ UINT* <span class="arg">bw</span> <span class="c">/* [OUT] 書き込まれたバイト数 */</span>
);
</pre>
</div>
<div class="para arg">
-<h4></h4>
+<h4>引数</h4>
<dl class="par">
<dt>fp</dt>
-<dd>t@CEIuWFNg\̂ւ̃|C^w肵܂B</dd>
+<dd>ファイル オブジェクト構造体へのポインタを指定します。</dd>
<dt>buff</dt>
-<dd>ރf[^i[obt@w|C^w肵܂B</dd>
+<dd>書き込むデータを格納したバッファを指すポインタを指定します。</dd>
<dt>btw</dt>
-<dd>ރoCg(0`<tt>UINT</tt>^̍ől)w肵܂B</dd>
+<dd>書き込むバイト数(0~<tt>UINT</tt>型の最大値)を指定します。</dd>
<dt>bw</dt>
-<dd>܂ꂽoCgi[ϐw|C^w肵܂B߂l͊֐̐ۂɂ炸ɗLłB</dd>
+<dd>書き込まれたバイト数を格納する変数を指すポインタを指定します。戻り値は関数の成否にかかわらず常に有効です。</dd>
</dl>
</div>
<div class="para ret">
-<h4>߂l</h4>
+<h4>戻り値</h4>
<p>
<a href="rc.html#ok">FR_OK</a>,
<a href="rc.html#de">FR_DISK_ERR</a>,
@@ -54,22 +54,22 @@ FRESULT f_write (
<div class="para desc">
-<h4></h4>
-<p>݊JnʒúA[h/CgE|C^̈ʒuɂȂ܂B[h/CgE|C^͎ۂɏ܂ꂽoCgi݂܂B֐IAvoCg܂ꂽǂ<tt class="arg">*bw</tt>`FbNׂłB<tt class="arg">*bw</tt><tt class="arg">btw</tt>菬Ƃ́AfBXNEtӖ܂BfBXNEtĂƂ܂͂ɋ߂Ƃ́A䂪A܂ŎԂꍇ܂B</p>
+<h4>解説</h4>
+<p>書き込み開始位置は、リード/ライト ポインタの位置からになります。リード/ライト ポインタは実際に書き込まれたバイト数だけ進みます。関数が正常終了した後、要求したバイト数が書き込まれたかどうか<tt class="arg">*bw</tt>をチェックすべきです。<tt class="arg">*bw</tt>が<tt class="arg">btw</tt>より小さいときは、ディスク フルを意味します。ディスク フルが発生しているときまたはそれに近いときは、制御が帰るまで時間がかかる場合があります。</p>
</div>
<div class="para comp">
-<h4>Ή</h4>
-<p><tt>_FS_READONLY == 0</tt>̂ƂɎgp”\łB</p>
+<h4>対応情報</h4>
+<p><tt>_FS_READONLY == 0</tt>のときに使用可能です。</p>
</div>
<div class="para ref">
-<h4>Q</h4>
+<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="putc.html">fputc</a>, <a href="puts.html">fputs</a>, <a href="printf.html">fprintf</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
-<p class="foot"><a href="../00index_j.html">߂</a></p>
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/fatfs/doc/updates.txt b/fatfs/doc/updates.txt
index f3054ed..20f64f4 100644
--- a/fatfs/doc/updates.txt
+++ b/fatfs/doc/updates.txt
@@ -1,3 +1,9 @@
+R0.10c, Nov 09, 2014
+ Added a configuration option for the platforms without RTC. (_FS_NORTC)
+ Fixed volume label created by Mac OS X cannot be retrieved with f_getlabel().
+ Fixed a potential problem of FAT access that can appear on disk error.
+ Fixed null pointer dereference on attempting to delete the root direcotry.
+
R0.10b, May 19, 2014
Fixed a hard error in the disk I/O layer can collapse the directory entry.
Fixed LFN entry is not deleted on delete/rename an object with its lossy converted SFN.
diff --git a/fatfs/src/00readme.txt b/fatfs/src/00readme.txt
index 7285d33..b30f7d3 100644
--- a/fatfs/src/00readme.txt
+++ b/fatfs/src/00readme.txt
@@ -1,4 +1,4 @@
-FatFs Module Source Files R0.10b (C)ChaN, 2014
+FatFs Module Source Files R0.10c (C)ChaN, 2014
FILES
@@ -156,3 +156,8 @@ REVISION HISTORY
Mar 19,'14 R0.10b Fixed a hard error in the disk I/O layer can collapse the directory entry.
Fixed LFN entry is not deleted on delete/rename an object with lossy converted SFN.
+
+ Nov 09,'14 R0.10c Added a configuration option for the platforms without RTC. (_FS_NORTC)
+ Fixed volume label created by Mac OS X cannot be retrieved with f_getlabel().
+ Fixed a potential problem of FAT access that can appear on disk error.
+ Fixed null pointer dereference on attempting to delete the root direcotry.
diff --git a/fatfs/src/diskio.c b/fatfs/src/diskio.c
index 64194eb..169ae95 100644
--- a/fatfs/src/diskio.c
+++ b/fatfs/src/diskio.c
@@ -1,10 +1,10 @@
/*-----------------------------------------------------------------------*/
-/* Low level disk I/O module skeleton for FatFs (C)ChaN, 2013 */
+/* Low level disk I/O module skeleton for FatFs (C)ChaN, 2014 */
/*-----------------------------------------------------------------------*/
/* If a working storage control module is available, it should be */
/* attached to the FatFs via a glue function rather than modifying it. */
/* This is an example of glue functions to attach various exsisting */
-/* storage control module to the FatFs module with a defined API. */
+/* storage control modules to the FatFs module with a defined API. */
/*-----------------------------------------------------------------------*/
#include "diskio.h" /* FatFs lower layer API */
@@ -12,18 +12,18 @@
#include "atadrive.h" /* Example: ATA drive control */
#include "sdcard.h" /* Example: MMC/SDC contorl */
-/* Definitions of physical drive number for each media */
-#define ATA 0
-#define MMC 1
-#define USB 2
+/* Definitions of physical drive number for each drive */
+#define ATA 0 /* Example: Map ATA drive to drive number 0 */
+#define MMC 1 /* Example: Map MMC/SD card to drive number 1 */
+#define USB 2 /* Example: Map USB drive to drive number 2 */
/*-----------------------------------------------------------------------*/
-/* Inidialize a Drive */
+/* Get Drive Status */
/*-----------------------------------------------------------------------*/
-DSTATUS disk_initialize (
- BYTE pdrv /* Physical drive nmuber (0..) */
+DSTATUS disk_status (
+ BYTE pdrv /* Physical drive nmuber to identify the drive */
)
{
DSTATUS stat;
@@ -31,21 +31,21 @@ DSTATUS disk_initialize (
switch (pdrv) {
case ATA :
- result = ATA_disk_initialize();
+ result = ATA_disk_status();
// translate the reslut code here
return stat;
case MMC :
- result = MMC_disk_initialize();
+ result = MMC_disk_status();
// translate the reslut code here
return stat;
case USB :
- result = USB_disk_initialize();
+ result = USB_disk_status();
// translate the reslut code here
@@ -57,11 +57,11 @@ DSTATUS disk_initialize (
/*-----------------------------------------------------------------------*/
-/* Get Disk Status */
+/* Inidialize a Drive */
/*-----------------------------------------------------------------------*/
-DSTATUS disk_status (
- BYTE pdrv /* Physical drive nmuber (0..) */
+DSTATUS disk_initialize (
+ BYTE pdrv /* Physical drive nmuber to identify the drive */
)
{
DSTATUS stat;
@@ -69,21 +69,21 @@ DSTATUS disk_status (
switch (pdrv) {
case ATA :
- result = ATA_disk_status();
+ result = ATA_disk_initialize();
// translate the reslut code here
return stat;
case MMC :
- result = MMC_disk_status();
+ result = MMC_disk_initialize();
// translate the reslut code here
return stat;
case USB :
- result = USB_disk_status();
+ result = USB_disk_initialize();
// translate the reslut code here
@@ -99,10 +99,10 @@ DSTATUS disk_status (
/*-----------------------------------------------------------------------*/
DRESULT disk_read (
- BYTE pdrv, /* Physical drive nmuber (0..) */
+ BYTE pdrv, /* Physical drive nmuber to identify the drive */
BYTE *buff, /* Data buffer to store read data */
- DWORD sector, /* Sector address (LBA) */
- UINT count /* Number of sectors to read (1..128) */
+ DWORD sector, /* Sector address in LBA */
+ UINT count /* Number of sectors to read */
)
{
DRESULT res;
@@ -136,6 +136,7 @@ DRESULT disk_read (
return res;
}
+
return RES_PARERR;
}
@@ -147,10 +148,10 @@ DRESULT disk_read (
#if _USE_WRITE
DRESULT disk_write (
- BYTE pdrv, /* Physical drive nmuber (0..) */
+ BYTE pdrv, /* Physical drive nmuber to identify the drive */
const BYTE *buff, /* Data to be written */
- DWORD sector, /* Sector address (LBA) */
- UINT count /* Number of sectors to write (1..128) */
+ DWORD sector, /* Sector address in LBA */
+ UINT count /* Number of sectors to write */
)
{
DRESULT res;
@@ -184,6 +185,7 @@ DRESULT disk_write (
return res;
}
+
return RES_PARERR;
}
#endif
@@ -205,32 +207,24 @@ DRESULT disk_ioctl (
switch (pdrv) {
case ATA :
- // pre-process here
-
- result = ATA_disk_ioctl(cmd, buff);
- // post-process here
+ // Process of the command for the ATA drive
return res;
case MMC :
- // pre-process here
- result = MMC_disk_ioctl(cmd, buff);
-
- // post-process here
+ // Process of the command for the MMC/SD card
return res;
case USB :
- // pre-process here
-
- result = USB_disk_ioctl(cmd, buff);
- // post-process here
+ // Process of the command the USB drive
return res;
}
+
return RES_PARERR;
}
#endif
diff --git a/fatfs/src/diskio.h b/fatfs/src/diskio.h
index 3c2b09d..9650f68 100644
--- a/fatfs/src/diskio.h
+++ b/fatfs/src/diskio.h
@@ -1,5 +1,5 @@
/*-----------------------------------------------------------------------/
-/ Low level disk interface modlue include file (C)ChaN, 2013 /
+/ Low level disk interface modlue include file (C)ChaN, 2014 /
/-----------------------------------------------------------------------*/
#ifndef _DISKIO_DEFINED
@@ -48,14 +48,14 @@ DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
/* Command code for disk_ioctrl fucntion */
-/* Generic command (used by FatFs) */
-#define CTRL_SYNC 0 /* Flush disk cache (for write functions) */
-#define GET_SECTOR_COUNT 1 /* Get media size (for only f_mkfs()) */
-#define GET_SECTOR_SIZE 2 /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */
-#define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */
-#define CTRL_ERASE_SECTOR 4 /* Force erased a block of sectors (for only _USE_ERASE) */
+/* Generic command (Used by FatFs) */
+#define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */
+#define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */
+#define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */
+#define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */
+#define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */
-/* Generic command (not used by FatFs) */
+/* Generic command (Not used by FatFs) */
#define CTRL_POWER 5 /* Get/Set power status */
#define CTRL_LOCK 6 /* Lock/Unlock media removal */
#define CTRL_EJECT 7 /* Eject media */
diff --git a/fatfs/src/ff.c b/fatfs/src/ff.c
index 2edbe32..9c887c4 100644
--- a/fatfs/src/ff.c
+++ b/fatfs/src/ff.c
@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------/
-/ FatFs - FAT file system module R0.10b (C)ChaN, 2014
+/ FatFs - FAT file system module R0.10c (C)ChaN, 2014
/-----------------------------------------------------------------------------/
/ FatFs module is a generic FAT file system module for small embedded systems.
/ This is a free software that opened for education, research and commercial
@@ -113,6 +113,10 @@
/ Fixed creation of an entry with LFN fails on too many SFN collisions.
/ May 19,'14 R0.10b Fixed a hard error in the disk I/O layer can collapse the directory entry.
/ Fixed LFN entry is not deleted on delete/rename an object with lossy converted SFN.
+/ Nov 09,'14 R0.10c Added a configuration option for the platforms without RTC. (_FS_NORTC)
+/ Fixed volume label created by Mac OS X cannot be retrieved with f_getlabel().
+/ Fixed a potential problem of FAT access that can appear on disk error.
+/ Fixed null pointer dereference on attempting to delete the root direcotry.
/---------------------------------------------------------------------------*/
#include "ff.h" /* Declarations of FatFs API */
@@ -127,7 +131,7 @@
---------------------------------------------------------------------------*/
-#if _FATFS != 8051 /* Revision ID */
+#if _FATFS != 80376 /* Revision ID */
#error Wrong include file (ff.h).
#endif
@@ -135,7 +139,7 @@
/* Reentrancy related */
#if _FS_REENTRANT
#if _USE_LFN == 1
-#error Static LFN work area cannot be used at thread-safe configuration.
+#error Static LFN work area cannot be used at thread-safe configuration
#endif
#define ENTER_FF(fs) { if (!lock_fs(fs)) return FR_TIMEOUT; }
#define LEAVE_FF(fs, res) { unlock_fs(fs, res); return res; }
@@ -149,7 +153,7 @@
/* Definitions of sector size */
#if (_MAX_SS < _MIN_SS) || (_MAX_SS != 512 && _MAX_SS != 1024 && _MAX_SS != 2048 && _MAX_SS != 4096) || (_MIN_SS != 512 && _MIN_SS != 1024 && _MIN_SS != 2048 && _MIN_SS != 4096)
-#error Wrong sector size configuration.
+#error Wrong sector size configuration
#endif
#if _MAX_SS == _MIN_SS
#define SS(fs) ((UINT)_MAX_SS) /* Fixed sector size */
@@ -158,10 +162,18 @@
#endif
+/* Timestamp feature */
+#if _FS_NORTC
+#define GET_FATTIME() ((DWORD)_NORTC_YEAR << 25 | (DWORD)_NORTC_MON << 21 | (DWORD)_NORTC_MDAY << 16)
+#else
+#define GET_FATTIME() get_fattime()
+#endif
+
+
/* File access control feature */
#if _FS_LOCK
#if _FS_READONLY
-#error _FS_LOCK must be 0 at read-only cfg.
+#error _FS_LOCK must be 0 at read-only configuration
#endif
typedef struct {
FATFS *fs; /* Object ID 1, volume (NULL:blank entry) */
@@ -398,7 +410,7 @@ typedef struct {
/* Name status flags */
-#define NS 11 /* Index of name status byte in fn[] */
+#define NSFLAG 11 /* Index of name status byte in fn[] */
#define NS_LOSS 0x01 /* Out of 8.3 format */
#define NS_LFN 0x02 /* Force to create LFN entry */
#define NS_LAST 0x04 /* Last segment */
@@ -407,16 +419,16 @@ typedef struct {
#define NS_DOT 0x20 /* Dot entry */
-/* FAT sub-type boundaries */
-#define MIN_FAT16 4086U /* Minimum number of clusters for FAT16 */
-#define MIN_FAT32 65526U /* Minimum number of clusters for FAT32 */
+/* FAT sub-type boundaries (Differ from specs but correct for real DOS/Windows) */
+#define MIN_FAT16 4086U /* Minimum number of clusters as FAT16 */
+#define MIN_FAT32 65526U /* Minimum number of clusters as FAT32 */
/* FatFs refers the members in the FAT structures as byte array instead of
/ structure member because the structure is not binary compatible between
/ different platforms */
-#define BS_jmpBoot 0 /* Jump instruction (3) */
+#define BS_jmpBoot 0 /* x86 jump instruction (3) */
#define BS_OEMName 3 /* OEM name (8) */
#define BPB_BytsPerSec 11 /* Sector size [byte] (2) */
#define BPB_SecPerClus 13 /* Cluster size [sector] (1) */
@@ -482,63 +494,53 @@ typedef struct {
/*------------------------------------------------------------*/
/* Module private work area */
/*------------------------------------------------------------*/
-/* Note that uninitialized variables with static duration are
-/ guaranteed zero/null as initial value. If not, either the
-/ linker or start-up routine is out of ANSI-C standard.
+/* Remark: Uninitialized variables with static duration are
+/ guaranteed zero/null at start-up. If not, either the linker
+/ or start-up routine being used is out of ANSI-C standard.
*/
-#if _VOLUMES >= 1 || _VOLUMES <= 10
-static
-FATFS *FatFs[_VOLUMES]; /* Pointer to the file system objects (logical drives) */
-#else
-#error Number of volumes must be 1 to 10.
+#if _VOLUMES < 1 || _VOLUMES > 9
+#error Wrong _VOLUMES setting
#endif
-
-static
-WORD Fsid; /* File system mount ID */
+static FATFS *FatFs[_VOLUMES]; /* Pointer to the file system objects (logical drives) */
+static WORD Fsid; /* File system mount ID */
#if _FS_RPATH && _VOLUMES >= 2
-static
-BYTE CurrVol; /* Current drive */
+static BYTE CurrVol; /* Current drive */
#endif
#if _FS_LOCK
-static
-FILESEM Files[_FS_LOCK]; /* Open object lock semaphores */
+static FILESEM Files[_FS_LOCK]; /* Open object lock semaphores */
#endif
-#if _USE_LFN == 0 /* No LFN feature */
+#if _USE_LFN == 0 /* Non LFN feature */
#define DEF_NAMEBUF BYTE sfn[12]
#define INIT_BUF(dobj) (dobj).fn = sfn
#define FREE_BUF()
-
-#elif _USE_LFN == 1 /* LFN feature with static working buffer */
-static
-WCHAR LfnBuf[_MAX_LFN+1];
+#else
+#if _MAX_LFN < 12 || _MAX_LFN > 255
+#error Wrong _MAX_LFN setting
+#endif
+#if _USE_LFN == 1 /* LFN feature with static working buffer */
+static WCHAR LfnBuf[_MAX_LFN+1];
#define DEF_NAMEBUF BYTE sfn[12]
#define INIT_BUF(dobj) { (dobj).fn = sfn; (dobj).lfn = LfnBuf; }
#define FREE_BUF()
-
#elif _USE_LFN == 2 /* LFN feature with dynamic working buffer on the stack */
#define DEF_NAMEBUF BYTE sfn[12]; WCHAR lbuf[_MAX_LFN+1]
#define INIT_BUF(dobj) { (dobj).fn = sfn; (dobj).lfn = lbuf; }
#define FREE_BUF()
-
#elif _USE_LFN == 3 /* LFN feature with dynamic working buffer on the heap */
#define DEF_NAMEBUF BYTE sfn[12]; WCHAR *lfn
-#define INIT_BUF(dobj) { lfn = ff_memalloc((_MAX_LFN + 1) * 2); \
- if (!lfn) LEAVE_FF((dobj).fs, FR_NOT_ENOUGH_CORE); \
- (dobj).lfn = lfn; (dobj).fn = sfn; }
+#define INIT_BUF(dobj) { lfn = ff_memalloc((_MAX_LFN + 1) * 2); if (!lfn) LEAVE_FF((dobj).fs, FR_NOT_ENOUGH_CORE); (dobj).lfn = lfn; (dobj).fn = sfn; }
#define FREE_BUF() ff_memfree(lfn)
-
#else
-#error Wrong LFN configuration.
+#error Wrong _USE_LFN setting
+#endif
#endif
-
#ifdef _EXCVT
-static
-const BYTE ExCvt[] = _EXCVT; /* Upper conversion table for extended characters */
+static const BYTE ExCvt[] = _EXCVT; /* Upper conversion table for extended characters */
#endif
@@ -758,21 +760,24 @@ FRESULT sync_window (
{
DWORD wsect;
UINT nf;
+ FRESULT res = FR_OK;
if (fs->wflag) { /* Write back the sector if it is dirty */
wsect = fs->winsect; /* Current sector number */
- if (disk_write(fs->drv, fs->win, wsect, 1))
- return FR_DISK_ERR;
- fs->wflag = 0;
- if (wsect - fs->fatbase < fs->fsize) { /* Is it in the FAT area? */
- for (nf = fs->n_fats; nf >= 2; nf--) { /* Reflect the change to all FAT copies */
- wsect += fs->fsize;
- disk_write(fs->drv, fs->win, wsect, 1);
+ if (disk_write(fs->drv, fs->win, wsect, 1) != RES_OK) {
+ res = FR_DISK_ERR;
+ } else {
+ fs->wflag = 0;
+ if (wsect - fs->fatbase < fs->fsize) { /* Is it in the FAT area? */
+ for (nf = fs->n_fats; nf >= 2; nf--) { /* Reflect the change to all FAT copies */
+ wsect += fs->fsize;
+ disk_write(fs->drv, fs->win, wsect, 1);
+ }
}
}
}
- return FR_OK;
+ return res;
}
#endif
@@ -783,17 +788,22 @@ FRESULT move_window (
DWORD sector /* Sector number to make appearance in the fs->win[] */
)
{
- if (sector != fs->winsect) { /* Changed current window */
+ FRESULT res = FR_OK;
+
+
+ if (sector != fs->winsect) { /* Window offset changed? */
#if !_FS_READONLY
- if (sync_window(fs) != FR_OK)
- return FR_DISK_ERR;
+ res = sync_window(fs); /* Write-back changes */
#endif
- if (disk_read(fs->drv, fs->win, sector, 1))
- return FR_DISK_ERR;
- fs->winsect = sector;
+ if (res == FR_OK) { /* Fill sector window with new data */
+ if (disk_read(fs->drv, fs->win, sector, 1) != RES_OK) {
+ sector = 0xFFFFFFFF; /* Invalidate window if data is not reliable */
+ res = FR_DISK_ERR;
+ }
+ fs->winsect = sector;
+ }
}
-
- return FR_OK;
+ return res;
}
@@ -842,7 +852,7 @@ FRESULT sync_fs ( /* FR_OK: successful, FR_DISK_ERR: failed */
/*-----------------------------------------------------------------------*/
/* Get sector# from cluster# */
/*-----------------------------------------------------------------------*/
-
+/* Hidden API for hacks and disk tools */
DWORD clust2sect ( /* !=0: Sector number, 0: Failed - invalid cluster# */
FATFS* fs, /* File system object */
@@ -850,7 +860,7 @@ DWORD clust2sect ( /* !=0: Sector number, 0: Failed - invalid cluster# */
)
{
clst -= 2;
- if (clst >= (fs->n_fatent - 2)) return 0; /* Invalid cluster# */
+ if (clst >= fs->n_fatent - 2) return 0; /* Invalid cluster# */
return clst * fs->csize + fs->database;
}
@@ -860,44 +870,52 @@ DWORD clust2sect ( /* !=0: Sector number, 0: Failed - invalid cluster# */
/*-----------------------------------------------------------------------*/
/* FAT access - Read value of a FAT entry */
/*-----------------------------------------------------------------------*/
+/* Hidden API for hacks and disk tools */
-
-DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, Else:Cluster status */
+DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, 2..0x0FFFFFFF:Cluster status */
FATFS* fs, /* File system object */
- DWORD clst /* Cluster# to get the link information */
+ DWORD clst /* FAT item index (cluster#) to get the value */
)
{
UINT wc, bc;
BYTE *p;
+ DWORD val;
- if (clst < 2 || clst >= fs->n_fatent) /* Check range */
- return 1;
+ if (clst < 2 || clst >= fs->n_fatent) { /* Check range */
+ val = 1; /* Internal error */
- switch (fs->fs_type) {
- case FS_FAT12 :
- bc = (UINT)clst; bc += bc / 2;
- if (move_window(fs, fs->fatbase + (bc / SS(fs)))) break;
- wc = fs->win[bc % SS(fs)]; bc++;
- if (move_window(fs, fs->fatbase + (bc / SS(fs)))) break;
- wc |= fs->win[bc % SS(fs)] << 8;
- return clst & 1 ? wc >> 4 : (wc & 0xFFF);
+ } else {
+ val = 0xFFFFFFFF; /* Default value falls on disk error */
- case FS_FAT16 :
- if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 2)))) break;
- p = &fs->win[clst * 2 % SS(fs)];
- return LD_WORD(p);
+ switch (fs->fs_type) {
+ case FS_FAT12 :
+ bc = (UINT)clst; bc += bc / 2;
+ if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break;
+ wc = fs->win[bc++ % SS(fs)];
+ if (move_window(fs, fs->fatbase + (bc / SS(fs))) != FR_OK) break;
+ wc |= fs->win[bc % SS(fs)] << 8;
+ val = clst & 1 ? wc >> 4 : (wc & 0xFFF);
+ break;
+
+ case FS_FAT16 :
+ if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 2))) != FR_OK) break;
+ p = &fs->win[clst * 2 % SS(fs)];
+ val = LD_WORD(p);
+ break;
- case FS_FAT32 :
- if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 4)))) break;
- p = &fs->win[clst * 4 % SS(fs)];
- return LD_DWORD(p) & 0x0FFFFFFF;
+ case FS_FAT32 :
+ if (move_window(fs, fs->fatbase + (clst / (SS(fs) / 4))) != FR_OK) break;
+ p = &fs->win[clst * 4 % SS(fs)];
+ val = LD_DWORD(p) & 0x0FFFFFFF;
+ break;
- default:
- return 1;
+ default:
+ val = 1; /* Internal error */
+ }
}
- return 0xFFFFFFFF; /* An error occurred at the disk I/O layer */
+ return val;
}
@@ -906,11 +924,12 @@ DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, Else:Cluster status
/*-----------------------------------------------------------------------*/
/* FAT access - Change value of a FAT entry */
/*-----------------------------------------------------------------------*/
-#if !_FS_READONLY
+/* Hidden API for hacks and disk tools */
+#if !_FS_READONLY
FRESULT put_fat (
FATFS* fs, /* File system object */
- DWORD clst, /* Cluster# to be changed in range of 2 to fs->n_fatent - 1 */
+ DWORD clst, /* FAT item index (cluster#) to be set */
DWORD val /* New value to mark the cluster */
)
{
@@ -928,14 +947,14 @@ FRESULT put_fat (
bc = (UINT)clst; bc += bc / 2;
res = move_window(fs, fs->fatbase + (bc / SS(fs)));
if (res != FR_OK) break;
- p = &fs->win[bc % SS(fs)];
+ p = &fs->win[bc++ % SS(fs)];
*p = (clst & 1) ? ((*p & 0x0F) | ((BYTE)val << 4)) : (BYTE)val;
- bc++;
fs->wflag = 1;
res = move_window(fs, fs->fatbase + (bc / SS(fs)));
if (res != FR_OK) break;
p = &fs->win[bc % SS(fs)];
*p = (clst & 1) ? (BYTE)(val >> 4) : ((*p & 0xF0) | ((BYTE)(val >> 8) & 0x0F));
+ fs->wflag = 1;
break;
case FS_FAT16 :
@@ -943,6 +962,7 @@ FRESULT put_fat (
if (res != FR_OK) break;
p = &fs->win[clst * 2 % SS(fs)];
ST_WORD(p, (WORD)val);
+ fs->wflag = 1;
break;
case FS_FAT32 :
@@ -951,12 +971,12 @@ FRESULT put_fat (
p = &fs->win[clst * 4 % SS(fs)];
val |= LD_DWORD(p) & 0xF0000000;
ST_DWORD(p, val);
+ fs->wflag = 1;
break;
default :
res = FR_INT_ERR;
}
- fs->wflag = 1;
}
return res;
@@ -978,7 +998,7 @@ FRESULT remove_chain (
{
FRESULT res;
DWORD nxt;
-#if _USE_ERASE
+#if _USE_TRIM
DWORD scl = clst, ecl = clst, rt[2];
#endif
@@ -998,13 +1018,13 @@ FRESULT remove_chain (
fs->free_clust++;
fs->fsi_flag |= 1;
}
-#if _USE_ERASE
+#if _USE_TRIM
if (ecl + 1 == nxt) { /* Is next cluster contiguous? */
ecl = nxt;
} else { /* End of contiguous clusters */
rt[0] = clust2sect(fs, scl); /* Start sector */
rt[1] = clust2sect(fs, ecl) + fs->csize - 1; /* End sector */
- disk_ioctl(fs->drv, CTRL_ERASE_SECTOR, rt); /* Erase the block */
+ disk_ioctl(fs->drv, CTRL_TRIM, rt); /* Erase the block */
scl = ecl = nxt;
}
#endif
@@ -1246,8 +1266,8 @@ FRESULT dir_alloc (
do {
res = move_window(dp->fs, dp->sect);
if (res != FR_OK) break;
- if (dp->dir[0] == DDE || dp->dir[0] == 0) { /* Is it a blank entry? */
- if (++n == nent) break; /* A block of contiguous entries is found */
+ if (dp->dir[0] == DDE || dp->dir[0] == 0) { /* Is it a free entry? */
+ if (++n == nent) break; /* A block of contiguous free entries is found */
} else {
n = 0; /* Not a blank entry. Restart to search */
}
@@ -1526,7 +1546,7 @@ FRESULT dir_find (
}
} else { /* An SFN entry is found */
if (!ord && sum == sum_sfn(dir)) break; /* LFN matched? */
- if (!(dp->fn[NS] & NS_LOSS) && !mem_cmp(dir, dp->fn, 11)) break; /* SFN matched? */
+ if (!(dp->fn[NSFLAG] & NS_LOSS) && !mem_cmp(dir, dp->fn, 11)) break; /* SFN matched? */
ord = 0xFF; dp->lfn_idx = 0xFFFF; /* Reset LFN sequence */
}
}
@@ -1568,7 +1588,7 @@ FRESULT dir_read (
if (c == 0) { res = FR_NO_FILE; break; } /* Reached to end of table */
a = dir[DIR_Attr] & AM_MASK;
#if _USE_LFN /* LFN configuration */
- if (c == DDE || (!_FS_RPATH && c == '.') || (int)(a == AM_VOL) != vol) { /* An entry without valid data */
+ if (c == DDE || (!_FS_RPATH && c == '.') || (int)((a & ~AM_ARC) == AM_VOL) != vol) { /* An entry without valid data */
ord = 0xFF;
} else {
if (a == AM_LFN) { /* An LFN entry is found */
@@ -1586,7 +1606,7 @@ FRESULT dir_read (
}
}
#else /* Non LFN configuration */
- if (c != DDE && (_FS_RPATH || c != '.') && a != AM_LFN && (int)(a == AM_VOL) == vol) /* Is it a valid entry? */
+ if (c != DDE && (_FS_RPATH || c != '.') && a != AM_LFN && (int)((a & ~AM_ARC) == AM_VOL) == vol) /* Is it a valid entry? */
break;
#endif
res = dir_next(dp, 0); /* Next entry */
@@ -1621,11 +1641,11 @@ FRESULT dir_register ( /* FR_OK:Successful, FR_DENIED:No free entry or too many
fn = dp->fn; lfn = dp->lfn;
mem_cpy(sn, fn, 12);
- if (_FS_RPATH && (sn[NS] & NS_DOT)) /* Cannot create dot entry */
+ if (_FS_RPATH && (sn[NSFLAG] & NS_DOT)) /* Cannot create dot entry */
return FR_INVALID_NAME;
- if (sn[NS] & NS_LOSS) { /* When LFN is out of 8.3 format, generate a numbered name */
- fn[NS] = 0; dp->lfn = 0; /* Find only SFN */
+ if (sn[NSFLAG] & NS_LOSS) { /* When LFN is out of 8.3 format, generate a numbered name */
+ fn[NSFLAG] = 0; dp->lfn = 0; /* Find only SFN */
for (n = 1; n < 100; n++) {
gen_numname(fn, sn, lfn, n); /* Generate a numbered name */
res = dir_find(dp); /* Check if the name collides with existing SFN */
@@ -1633,10 +1653,10 @@ FRESULT dir_register ( /* FR_OK:Successful, FR_DENIED:No free entry or too many
}
if (n == 100) return FR_DENIED; /* Abort if too many collisions */
if (res != FR_NO_FILE) return res; /* Abort if the result is other than 'not collided' */
- fn[NS] = sn[NS]; dp->lfn = lfn;
+ fn[NSFLAG] = sn[NSFLAG]; dp->lfn = lfn;
}
- if (sn[NS] & NS_LFN) { /* When LFN is to be created, allocate entries for an SFN + LFNs. */
+ if (sn[NSFLAG] & NS_LFN) { /* When LFN is to be created, allocate entries for an SFN + LFNs. */
for (n = 0; lfn[n]; n++) ;
nent = (n + 25) / 13;
} else { /* Otherwise allocate an entry for an SFN */
@@ -1667,7 +1687,7 @@ FRESULT dir_register ( /* FR_OK:Successful, FR_DENIED:No free entry or too many
mem_set(dp->dir, 0, SZ_DIR); /* Clean the entry */
mem_cpy(dp->dir, dp->fn, 11); /* Put SFN */
#if _USE_LFN
- dp->dir[DIR_NTres] = dp->fn[NS] & (NS_BODY | NS_EXT); /* Put NT flag */
+ dp->dir[DIR_NTres] = dp->fn[NSFLAG] & (NS_BODY | NS_EXT); /* Put NT flag */
#endif
dp->fs->wflag = 1;
}
@@ -1923,7 +1943,7 @@ FRESULT create_name (
if ((b & 0x0C) == 0x04) cf |= NS_BODY; /* NT flag (Filename has only small capital) */
}
- dp->fn[NS] = cf; /* SFN is created */
+ dp->fn[NSFLAG] = cf; /* SFN is created */
return FR_OK;
@@ -1947,7 +1967,7 @@ FRESULT create_name (
}
if (c != '/' && c != '\\' && c > ' ') return FR_INVALID_NAME;
*path = &p[si]; /* Return pointer to the next segment */
- sfn[NS] = (c <= ' ') ? NS_LAST | NS_DOT : NS_DOT; /* Set last segment flag if end of path */
+ sfn[NSFLAG] = (c <= ' ') ? NS_LAST | NS_DOT : NS_DOT; /* Set last segment flag if end of path */
return FR_OK;
}
#endif
@@ -1998,7 +2018,7 @@ FRESULT create_name (
if ((b & 0x03) == 0x01) c |= NS_EXT; /* NT flag (Name extension has only small capital) */
if ((b & 0x0C) == 0x04) c |= NS_BODY; /* NT flag (Name body has only small capital) */
- sfn[NS] = c; /* Store NT flag, File name is created */
+ sfn[NSFLAG] = c; /* Store NT flag, File name is created */
return FR_OK;
#endif
@@ -2041,7 +2061,7 @@ FRESULT follow_path ( /* FR_OK(0): successful, !=0: error code */
res = create_name(dp, &path); /* Get a segment name of the path */
if (res != FR_OK) break;
res = dir_find(dp); /* Find an object with the sagment name */
- ns = dp->fn[NS];
+ ns = dp->fn[NSFLAG];
if (res != FR_OK) { /* Failed to find the object */
if (res == FR_NO_FILE) { /* Object is not found */
if (_FS_RPATH && (ns & NS_DOT)) { /* If dot entry is not exist, */
@@ -2283,7 +2303,7 @@ FRESULT find_volume ( /* FR_OK(0): successful, !=0: any error occurred */
szbfat = (fmt == FS_FAT16) ? /* (Needed FAT size) */
fs->n_fatent * 2 : fs->n_fatent * 3 / 2 + (fs->n_fatent & 1);
}
- if (fs->fsize < (szbfat + (SS(fs) - 1)) / SS(fs)) /* (BPB_FATSz must not be less than needed) */
+ if (fs->fsize < (szbfat + (SS(fs) - 1)) / SS(fs)) /* (BPB_FATSz must not be less than the size needed) */
return FR_NO_FILESYSTEM;
#if !_FS_READONLY
@@ -2471,7 +2491,7 @@ FRESULT f_open (
}
}
if (res == FR_OK && (mode & FA_CREATE_ALWAYS)) { /* Truncate it if overwrite mode */
- dw = get_fattime(); /* Created time */
+ dw = GET_FATTIME(); /* Created time */
ST_DWORD(dir+DIR_CrtTime, dw);
dir[DIR_Attr] = 0; /* Reset attribute */
ST_DWORD(dir+DIR_FileSize, 0); /* size = 0 */
@@ -2597,7 +2617,7 @@ FRESULT f_read (
if (cc) { /* Read maximum contiguous sectors directly */
if (csect + cc > fp->fs->csize) /* Clip at cluster boundary */
cc = fp->fs->csize - csect;
- if (disk_read(fp->fs->drv, rbuff, sect, cc))
+ if (disk_read(fp->fs->drv, rbuff, sect, cc) != RES_OK)
ABORT(fp->fs, FR_DISK_ERR);
#if !_FS_READONLY && _FS_MINIMIZE <= 2 /* Replace one of the read sectors with cached data if it contains a dirty sector */
#if _FS_TINY
@@ -2615,12 +2635,12 @@ FRESULT f_read (
if (fp->dsect != sect) { /* Load data sector if not in cache */
#if !_FS_READONLY
if (fp->flag & FA__DIRTY) { /* Write-back dirty sector cache */
- if (disk_write(fp->fs->drv, fp->buf, fp->dsect, 1))
+ if (disk_write(fp->fs->drv, fp->buf, fp->dsect, 1) != RES_OK)
ABORT(fp->fs, FR_DISK_ERR);
fp->flag &= ~FA__DIRTY;
}
#endif
- if (disk_read(fp->fs->drv, fp->buf, sect, 1)) /* Fill sector cache */
+ if (disk_read(fp->fs->drv, fp->buf, sect, 1) != RES_OK) /* Fill sector cache */
ABORT(fp->fs, FR_DISK_ERR);
}
#endif
@@ -2629,7 +2649,7 @@ FRESULT f_read (
rcnt = SS(fp->fs) - ((UINT)fp->fptr % SS(fp->fs)); /* Get partial sector data from sector buffer */
if (rcnt > btr) rcnt = btr;
#if _FS_TINY
- if (move_window(fp->fs, fp->dsect)) /* Move sector window */
+ if (move_window(fp->fs, fp->dsect) != FR_OK) /* Move sector window */
ABORT(fp->fs, FR_DISK_ERR);
mem_cpy(rbuff, &fp->fs->win[fp->fptr % SS(fp->fs)], rcnt); /* Pick partial sector */
#else
@@ -2700,7 +2720,7 @@ FRESULT f_write (
ABORT(fp->fs, FR_DISK_ERR);
#else
if (fp->flag & FA__DIRTY) { /* Write-back sector cache */
- if (disk_write(fp->fs->drv, fp->buf, fp->dsect, 1))
+ if (disk_write(fp->fs->drv, fp->buf, fp->dsect, 1) != RES_OK)
ABORT(fp->fs, FR_DISK_ERR);
fp->flag &= ~FA__DIRTY;
}
@@ -2712,7 +2732,7 @@ FRESULT f_write (
if (cc) { /* Write maximum contiguous sectors directly */
if (csect + cc > fp->fs->csize) /* Clip at cluster boundary */
cc = fp->fs->csize - csect;
- if (disk_write(fp->fs->drv, wbuff, sect, cc))
+ if (disk_write(fp->fs->drv, wbuff, sect, cc) != RES_OK)
ABORT(fp->fs, FR_DISK_ERR);
#if _FS_MINIMIZE <= 2
#if _FS_TINY
@@ -2738,7 +2758,7 @@ FRESULT f_write (
#else
if (fp->dsect != sect) { /* Fill sector cache with file data */
if (fp->fptr < fp->fsize &&
- disk_read(fp->fs->drv, fp->buf, sect, 1))
+ disk_read(fp->fs->drv, fp->buf, sect, 1) != RES_OK)
ABORT(fp->fs, FR_DISK_ERR);
}
#endif
@@ -2747,7 +2767,7 @@ FRESULT f_write (
wcnt = SS(fp->fs) - ((UINT)fp->fptr % SS(fp->fs));/* Put partial sector into file I/O buffer */
if (wcnt > btw) wcnt = btw;
#if _FS_TINY
- if (move_window(fp->fs, fp->dsect)) /* Move sector window */
+ if (move_window(fp->fs, fp->dsect) != FR_OK) /* Move sector window */
ABORT(fp->fs, FR_DISK_ERR);
mem_cpy(&fp->fs->win[fp->fptr % SS(fp->fs)], wbuff, wcnt); /* Fit partial sector */
fp->fs->wflag = 1;
@@ -2785,7 +2805,7 @@ FRESULT f_sync (
/* Write-back dirty buffer */
#if !_FS_TINY
if (fp->flag & FA__DIRTY) {
- if (disk_write(fp->fs->drv, fp->buf, fp->dsect, 1))
+ if (disk_write(fp->fs->drv, fp->buf, fp->dsect, 1) != RES_OK)
LEAVE_FF(fp->fs, FR_DISK_ERR);
fp->flag &= ~FA__DIRTY;
}
@@ -2797,7 +2817,7 @@ FRESULT f_sync (
dir[DIR_Attr] |= AM_ARC; /* Set archive bit */
ST_DWORD(dir+DIR_FileSize, fp->fsize); /* Update file size */
st_clust(dir, fp->sclust); /* Update start cluster */
- tm = get_fattime(); /* Update updated time */
+ tm = GET_FATTIME(); /* Update updated time */
ST_DWORD(dir+DIR_WrtTime, tm);
ST_WORD(dir+DIR_LstAccDate, 0);
fp->flag &= ~FA__WRITTEN;
@@ -3046,12 +3066,12 @@ FRESULT f_lseek (
#if !_FS_TINY
#if !_FS_READONLY
if (fp->flag & FA__DIRTY) { /* Write-back dirty sector cache */
- if (disk_write(fp->fs->drv, fp->buf, fp->dsect, 1))
+ if (disk_write(fp->fs->drv, fp->buf, fp->dsect, 1) != RES_OK)
ABORT(fp->fs, FR_DISK_ERR);
fp->flag &= ~FA__DIRTY;
}
#endif
- if (disk_read(fp->fs->drv, fp->buf, dsc, 1)) /* Load current sector */
+ if (disk_read(fp->fs->drv, fp->buf, dsc, 1) != RES_OK) /* Load current sector */
ABORT(fp->fs, FR_DISK_ERR);
#endif
fp->dsect = dsc;
@@ -3121,12 +3141,12 @@ FRESULT f_lseek (
#if !_FS_TINY
#if !_FS_READONLY
if (fp->flag & FA__DIRTY) { /* Write-back dirty sector cache */
- if (disk_write(fp->fs->drv, fp->buf, fp->dsect, 1))
+ if (disk_write(fp->fs->drv, fp->buf, fp->dsect, 1) != RES_OK)
ABORT(fp->fs, FR_DISK_ERR);
fp->flag &= ~FA__DIRTY;
}
#endif
- if (disk_read(fp->fs->drv, fp->buf, nsect, 1)) /* Fill sector cache */
+ if (disk_read(fp->fs->drv, fp->buf, nsect, 1) != RES_OK) /* Fill sector cache */
ABORT(fp->fs, FR_DISK_ERR);
#endif
fp->dsect = nsect;
@@ -3417,7 +3437,7 @@ FRESULT f_truncate (
}
#if !_FS_TINY
if (res == FR_OK && (fp->flag & FA__DIRTY)) {
- if (disk_write(fp->fs->drv, fp->buf, fp->dsect, 1))
+ if (disk_write(fp->fs->drv, fp->buf, fp->dsect, 1) != RES_OK)
res = FR_DISK_ERR;
else
fp->flag &= ~FA__DIRTY;
@@ -3444,7 +3464,7 @@ FRESULT f_unlink (
FRESULT res;
DIR dj, sdj;
BYTE *dir;
- DWORD dclst;
+ DWORD dclst = 0;
DEF_NAMEBUF;
@@ -3453,45 +3473,43 @@ FRESULT f_unlink (
if (res == FR_OK) {
INIT_BUF(dj);
res = follow_path(&dj, path); /* Follow the file path */
- if (_FS_RPATH && res == FR_OK && (dj.fn[NS] & NS_DOT))
+ if (_FS_RPATH && res == FR_OK && (dj.fn[NSFLAG] & NS_DOT))
res = FR_INVALID_NAME; /* Cannot remove dot entry */
#if _FS_LOCK
- if (res == FR_OK) res = chk_lock(&dj, 2); /* Cannot remove open file */
+ if (res == FR_OK) res = chk_lock(&dj, 2); /* Cannot remove open object */
#endif
if (res == FR_OK) { /* The object is accessible */
dir = dj.dir;
if (!dir) {
- res = FR_INVALID_NAME; /* Cannot remove the start directory */
+ res = FR_INVALID_NAME; /* Cannot remove the origin directory */
} else {
if (dir[DIR_Attr] & AM_RDO)
res = FR_DENIED; /* Cannot remove R/O object */
}
- dclst = ld_clust(dj.fs, dir);
if (res == FR_OK && (dir[DIR_Attr] & AM_DIR)) { /* Is it a sub-dir? */
- if (dclst < 2) {
+ dclst = ld_clust(dj.fs, dir);
+ if (!dclst) {
res = FR_INT_ERR;
- } else {
- mem_cpy(&sdj, &dj, sizeof (DIR)); /* Check if the sub-directory is empty or not */
+ } else { /* Make sure the sub-directory is empty */
+ mem_cpy(&sdj, &dj, sizeof (DIR));
sdj.sclust = dclst;
res = dir_sdi(&sdj, 2); /* Exclude dot entries */
if (res == FR_OK) {
res = dir_read(&sdj, 0); /* Read an item */
if (res == FR_OK /* Not empty directory */
#if _FS_RPATH
- || dclst == dj.fs->cdir /* Current directory */
+ || dclst == dj.fs->cdir /* or current directory */
#endif
) res = FR_DENIED;
- if (res == FR_NO_FILE) res = FR_OK; /* Empty */
+ if (res == FR_NO_FILE) res = FR_OK; /* It is empty */
}
}
}
if (res == FR_OK) {
res = dir_remove(&dj); /* Remove the directory entry */
- if (res == FR_OK) {
- if (dclst) /* Remove the cluster chain if exist */
- res = remove_chain(dj.fs, dclst);
- if (res == FR_OK) res = sync_fs(dj.fs);
- }
+ if (res == FR_OK && dclst) /* Remove the cluster chain if exist */
+ res = remove_chain(dj.fs, dclst);
+ if (res == FR_OK) res = sync_fs(dj.fs);
}
}
FREE_BUF();
@@ -3514,7 +3532,7 @@ FRESULT f_mkdir (
FRESULT res;
DIR dj;
BYTE *dir, n;
- DWORD dsc, dcl, pcl, tm = get_fattime();
+ DWORD dsc, dcl, pcl, tm = GET_FATTIME();
DEF_NAMEBUF;
@@ -3524,7 +3542,7 @@ FRESULT f_mkdir (
INIT_BUF(dj);
res = follow_path(&dj, path); /* Follow the file path */
if (res == FR_OK) res = FR_EXIST; /* Any object with same name is already existing */
- if (_FS_RPATH && res == FR_NO_FILE && (dj.fn[NS] & NS_DOT))
+ if (_FS_RPATH && res == FR_NO_FILE && (dj.fn[NSFLAG] & NS_DOT))
res = FR_INVALID_NAME;
if (res == FR_NO_FILE) { /* Can create a new directory */
dcl = create_chain(dj.fs, 0); /* Allocate a cluster for the new directory table */
@@ -3599,7 +3617,7 @@ FRESULT f_chmod (
INIT_BUF(dj);
res = follow_path(&dj, path); /* Follow the file path */
FREE_BUF();
- if (_FS_RPATH && res == FR_OK && (dj.fn[NS] & NS_DOT))
+ if (_FS_RPATH && res == FR_OK && (dj.fn[NSFLAG] & NS_DOT))
res = FR_INVALID_NAME;
if (res == FR_OK) {
dir = dj.dir;
@@ -3621,48 +3639,6 @@ FRESULT f_chmod (
/*-----------------------------------------------------------------------*/
-/* Change Timestamp */
-/*-----------------------------------------------------------------------*/
-
-FRESULT f_utime (
- const TCHAR* path, /* Pointer to the file/directory name */
- const FILINFO* fno /* Pointer to the time stamp to be set */
-)
-{
- FRESULT res;
- DIR dj;
- BYTE *dir;
- DEF_NAMEBUF;
-
-
- /* Get logical drive number */
- res = find_volume(&dj.fs, &path, 1);
- if (res == FR_OK) {
- INIT_BUF(dj);
- res = follow_path(&dj, path); /* Follow the file path */
- FREE_BUF();
- if (_FS_RPATH && res == FR_OK && (dj.fn[NS] & NS_DOT))
- res = FR_INVALID_NAME;
- if (res == FR_OK) {
- dir = dj.dir;
- if (!dir) { /* Root directory */
- res = FR_INVALID_NAME;
- } else { /* File or sub-directory */
- ST_WORD(dir+DIR_WrtTime, fno->ftime);
- ST_WORD(dir+DIR_WrtDate, fno->fdate);
- dj.fs->wflag = 1;
- res = sync_fs(dj.fs);
- }
- }
- }
-
- LEAVE_FF(dj.fs, res);
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
/* Rename File/Directory */
/*-----------------------------------------------------------------------*/
@@ -3684,7 +3660,7 @@ FRESULT f_rename (
djn.fs = djo.fs;
INIT_BUF(djo);
res = follow_path(&djo, path_old); /* Check old object */
- if (_FS_RPATH && res == FR_OK && (djo.fn[NS] & NS_DOT))
+ if (_FS_RPATH && res == FR_OK && (djo.fn[NSFLAG] & NS_DOT))
res = FR_INVALID_NAME;
#if _FS_LOCK
if (res == FR_OK) res = chk_lock(&djo, 2);
@@ -3696,19 +3672,19 @@ FRESULT f_rename (
mem_cpy(buf, djo.dir+DIR_Attr, 21); /* Save the object information except name */
mem_cpy(&djn, &djo, sizeof (DIR)); /* Duplicate the directory object */
if (get_ldnumber(&path_new) >= 0) /* Snip drive number off and ignore it */
- res = follow_path(&djn, path_new); /* and check if new object is exist */
+ res = follow_path(&djn, path_new); /* and make sure if new object name is not conflicting */
else
res = FR_INVALID_DRIVE;
if (res == FR_OK) res = FR_EXIST; /* The new object name is already existing */
- if (res == FR_NO_FILE) { /* Is it a valid path and no name collision? */
-/* Start critical section that any interruption can cause a cross-link */
+ if (res == FR_NO_FILE) { /* It is a valid path and no name collision */
+/* Start of critical section that any interruption can cause a cross-link */
res = dir_register(&djn); /* Register the new entry */
if (res == FR_OK) {
dir = djn.dir; /* Copy object information except name */
mem_cpy(dir+13, buf+2, 19);
dir[DIR_Attr] = buf[0] | AM_ARC;
djo.fs->wflag = 1;
- if (djo.sclust != djn.sclust && (dir[DIR_Attr] & AM_DIR)) { /* Update .. entry in the directory if needed */
+ if ((dir[DIR_Attr] & AM_DIR) && djo.sclust != djn.sclust) { /* Update .. entry in the directory if needed */
dw = clust2sect(djo.fs, ld_clust(djo.fs, dir));
if (!dw) {
res = FR_INT_ERR;
@@ -3716,8 +3692,7 @@ FRESULT f_rename (
res = move_window(djo.fs, dw);
dir = djo.fs->win+SZ_DIR; /* .. entry */
if (res == FR_OK && dir[1] == '.') {
- dw = (djo.fs->fs_type == FS_FAT32 && djn.sclust == djo.fs->dirbase) ? 0 : djn.sclust;
- st_clust(dir, dw);
+ st_clust(dir, djn.sclust);
djo.fs->wflag = 1;
}
}
@@ -3728,7 +3703,7 @@ FRESULT f_rename (
res = sync_fs(djo.fs);
}
}
-/* End critical section */
+/* End of critical section */
}
}
}
@@ -3738,6 +3713,48 @@ FRESULT f_rename (
LEAVE_FF(djo.fs, res);
}
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Change Timestamp */
+/*-----------------------------------------------------------------------*/
+
+FRESULT f_utime (
+ const TCHAR* path, /* Pointer to the file/directory name */
+ const FILINFO* fno /* Pointer to the time stamp to be set */
+)
+{
+ FRESULT res;
+ DIR dj;
+ BYTE *dir;
+ DEF_NAMEBUF;
+
+
+ /* Get logical drive number */
+ res = find_volume(&dj.fs, &path, 1);
+ if (res == FR_OK) {
+ INIT_BUF(dj);
+ res = follow_path(&dj, path); /* Follow the file path */
+ FREE_BUF();
+ if (_FS_RPATH && res == FR_OK && (dj.fn[NSFLAG] & NS_DOT))
+ res = FR_INVALID_NAME;
+ if (res == FR_OK) {
+ dir = dj.dir;
+ if (!dir) { /* Root directory */
+ res = FR_INVALID_NAME;
+ } else { /* File or sub-directory */
+ ST_WORD(dir+DIR_WrtTime, fno->ftime);
+ ST_WORD(dir+DIR_WrtDate, fno->fdate);
+ dj.fs->wflag = 1;
+ res = sync_fs(dj.fs);
+ }
+ }
+ }
+
+ LEAVE_FF(dj.fs, res);
+}
+
#endif /* !_FS_READONLY */
#endif /* _FS_MINIMIZE == 0 */
#endif /* _FS_MINIMIZE <= 1 */
@@ -3871,7 +3888,7 @@ FRESULT f_setlabel (
if (res == FR_OK) { /* A volume label is found */
if (vn[0]) {
mem_cpy(dj.dir, vn, 11); /* Change the volume label name */
- tm = get_fattime();
+ tm = GET_FATTIME();
ST_DWORD(dj.dir+DIR_WrtTime, tm);
} else {
dj.dir[0] = DDE; /* Remove the volume label */
@@ -3887,7 +3904,7 @@ FRESULT f_setlabel (
mem_set(dj.dir, 0, SZ_DIR); /* Set volume label */
mem_cpy(dj.dir, vn, 11);
dj.dir[DIR_Attr] = AM_VOL;
- tm = get_fattime();
+ tm = GET_FATTIME();
ST_DWORD(dj.dir+DIR_WrtTime, tm);
dj.fs->wflag = 1;
res = sync_fs(dj.fs);
@@ -3950,7 +3967,7 @@ FRESULT f_forward (
sect = clust2sect(fp->fs, fp->clust); /* Get current data sector */
if (!sect) ABORT(fp->fs, FR_INT_ERR);
sect += csect;
- if (move_window(fp->fs, sect)) /* Move sector window */
+ if (move_window(fp->fs, sect) != FR_OK) /* Move sector window */
ABORT(fp->fs, FR_DISK_ERR);
fp->dsect = sect;
rcnt = SS(fp->fs) - (WORD)(fp->fptr % SS(fp->fs)); /* Forward data from sector window */
@@ -3970,13 +3987,13 @@ FRESULT f_forward (
/* Create File System on the Drive */
/*-----------------------------------------------------------------------*/
#define N_ROOTDIR 512 /* Number of root directory entries for FAT12/16 */
-#define N_FATS 1 /* Number of FAT copies (1 or 2) */
+#define N_FATS 1 /* Number of FATs (1 or 2) */
FRESULT f_mkfs (
const TCHAR* path, /* Logical drive number */
BYTE sfd, /* Partitioning rule 0:FDISK, 1:SFD */
- UINT au /* Allocation unit [bytes] */
+ UINT au /* Size of allocation unit in unit of byte or sector */
)
{
static const WORD vst[] = { 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 0};
@@ -3992,10 +4009,9 @@ FRESULT f_mkfs (
/* Check mounted drive and clear work area */
+ if (sfd > 1) return FR_INVALID_PARAMETER;
vol = get_ldnumber(&path);
if (vol < 0) return FR_INVALID_DRIVE;
- if (sfd > 1) return FR_INVALID_PARAMETER;
- if (au & (au - 1)) return FR_INVALID_PARAMETER;
fs = FatFs[vol];
if (!fs) return FR_NOT_ENABLED;
fs->fs_type = 0;
@@ -4012,7 +4028,7 @@ FRESULT f_mkfs (
#endif
if (_MULTI_PARTITION && part) {
/* Get partition information from partition table in the MBR */
- if (disk_read(pdrv, fs->win, 0, 1)) return FR_DISK_ERR;
+ if (disk_read(pdrv, fs->win, 0, 1) != RES_OK) return FR_DISK_ERR;
if (LD_WORD(fs->win+BS_55AA) != 0xAA55) return FR_MKFS_ABORTED;
tbl = &fs->win[MBR_Table + (part - 1) * SZ_PTE];
if (!tbl[4]) return FR_MKFS_ABORTED; /* No partition? */
@@ -4026,13 +4042,14 @@ FRESULT f_mkfs (
n_vol -= b_vol; /* Volume size */
}
- if (!au) { /* AU auto selection */
+ if (au & (au - 1)) au = 0;
+ if (!au) { /* AU auto selection */
vs = n_vol / (2000 / (SS(fs) / 512));
for (i = 0; vs < vst[i]; i++) ;
au = cst[i];
}
- au /= SS(fs); /* Number of sectors per cluster */
- if (au == 0) au = 1;
+ if (au >= _MIN_SS) au /= SS(fs); /* Number of sectors per cluster */
+ if (!au) au = 1;
if (au > 128) au = 128;
/* Pre-compute number of clusters and FAT sub-type */
@@ -4089,7 +4106,7 @@ FRESULT f_mkfs (
/* Update system ID in the partition table */
tbl = &fs->win[MBR_Table + (part - 1) * SZ_PTE];
tbl[4] = sys;
- if (disk_write(pdrv, fs->win, 0, 1)) /* Write it to teh MBR */
+ if (disk_write(pdrv, fs->win, 0, 1) != RES_OK) /* Write it to teh MBR */
return FR_DISK_ERR;
md = 0xF8;
} else {
@@ -4109,7 +4126,7 @@ FRESULT f_mkfs (
ST_DWORD(tbl+8, 63); /* Partition start in LBA */
ST_DWORD(tbl+12, n_vol); /* Partition size in LBA */
ST_WORD(fs->win+BS_55AA, 0xAA55); /* MBR signature */
- if (disk_write(pdrv, fs->win, 0, 1)) /* Write it to the MBR */
+ if (disk_write(pdrv, fs->win, 0, 1) != RES_OK) /* Write it to the MBR */
return FR_DISK_ERR;
md = 0xF8;
}
@@ -4135,7 +4152,7 @@ FRESULT f_mkfs (
ST_WORD(tbl+BPB_SecPerTrk, 63); /* Number of sectors per track */
ST_WORD(tbl+BPB_NumHeads, 255); /* Number of heads */
ST_DWORD(tbl+BPB_HiddSec, b_vol); /* Hidden sectors */
- n = get_fattime(); /* Use current time as VSN */
+ n = GET_FATTIME(); /* Use current time as VSN */
if (fmt == FS_FAT32) {
ST_DWORD(tbl+BS_VolID32, n); /* VSN */
ST_DWORD(tbl+BPB_FATSz32, n_fat); /* Number of sectors per FAT */
@@ -4153,7 +4170,7 @@ FRESULT f_mkfs (
mem_cpy(tbl+BS_VolLab, "NO NAME " "FAT ", 19); /* Volume label, FAT signature */
}
ST_WORD(tbl+BS_55AA, 0xAA55); /* Signature (Offset is fixed here regardless of sector size) */
- if (disk_write(pdrv, tbl, b_vol, 1)) /* Write it to the VBR sector */
+ if (disk_write(pdrv, tbl, b_vol, 1) != RES_OK) /* Write it to the VBR sector */
return FR_DISK_ERR;
if (fmt == FS_FAT32) /* Write backup VBR if needed (VBR+6) */
disk_write(pdrv, tbl, b_vol + 6, 1);
@@ -4172,11 +4189,11 @@ FRESULT f_mkfs (
ST_DWORD(tbl+4, 0xFFFFFFFF);
ST_DWORD(tbl+8, 0x0FFFFFFF); /* Reserve cluster #2 for root directory */
}
- if (disk_write(pdrv, tbl, wsect++, 1))
+ if (disk_write(pdrv, tbl, wsect++, 1) != RES_OK)
return FR_DISK_ERR;
mem_set(tbl, 0, SS(fs)); /* Fill following FAT entries with zero */
for (n = 1; n < n_fat; n++) { /* This loop may take a time on FAT32 volume due to many single sector writes */
- if (disk_write(pdrv, tbl, wsect++, 1))
+ if (disk_write(pdrv, tbl, wsect++, 1) != RES_OK)
return FR_DISK_ERR;
}
}
@@ -4184,16 +4201,16 @@ FRESULT f_mkfs (
/* Initialize root directory */
i = (fmt == FS_FAT32) ? au : (UINT)n_dir;
do {
- if (disk_write(pdrv, tbl, wsect++, 1))
+ if (disk_write(pdrv, tbl, wsect++, 1) != RES_OK)
return FR_DISK_ERR;
} while (--i);
-#if _USE_ERASE /* Erase data area if needed */
+#if _USE_TRIM /* Erase data area if needed */
{
DWORD eb[2];
eb[0] = wsect; eb[1] = wsect + (n_clst - ((fmt == FS_FAT32) ? 1 : 0)) * au - 1;
- disk_ioctl(pdrv, CTRL_ERASE_SECTOR, eb);
+ disk_ioctl(pdrv, CTRL_TRIM, eb);
}
#endif
@@ -4276,7 +4293,7 @@ FRESULT f_fdisk (
ST_WORD(p, 0xAA55);
/* Write it to the MBR */
- return (disk_write(pdrv, buf, 0, 1) || disk_ioctl(pdrv, CTRL_SYNC, 0)) ? FR_DISK_ERR : FR_OK;
+ return (disk_write(pdrv, buf, 0, 1) != RES_OK || disk_ioctl(pdrv, CTRL_SYNC, 0) != RES_OK) ? FR_DISK_ERR : FR_OK;
}
diff --git a/fatfs/src/ff.h b/fatfs/src/ff.h
index 9894921..5eaad5f 100644
--- a/fatfs/src/ff.h
+++ b/fatfs/src/ff.h
@@ -1,5 +1,5 @@
/*---------------------------------------------------------------------------/
-/ FatFs - FAT file system module include file R0.10b (C)ChaN, 2014
+/ FatFs - FAT file system module include file R0.10c (C)ChaN, 2014
/----------------------------------------------------------------------------/
/ FatFs module is a generic FAT file system module for small embedded systems.
/ This is a free software that opened for education, research and commercial
@@ -15,7 +15,7 @@
/----------------------------------------------------------------------------*/
#ifndef _FATFS
-#define _FATFS 8051 /* Revision ID */
+#define _FATFS 80376 /* Revision ID */
#ifdef __cplusplus
extern "C" {
@@ -23,7 +23,6 @@ extern "C" {
#include "integer.h" /* Basic integer types */
#include "ffconf.h" /* FatFs configuration options */
-
#if _FATFS != _FFCONF
#error Wrong configuration file (ffconf.h).
#endif
@@ -236,7 +235,7 @@ int f_puts (const TCHAR* str, FIL* cp); /* Put a string to the file */
int f_printf (FIL* fp, const TCHAR* str, ...); /* Put a formatted string to the file */
TCHAR* f_gets (TCHAR* buff, int len, FIL* fp); /* Get a string from the file */
-#define f_eof(fp) (((fp)->fptr == (fp)->fsize) ? 1 : 0)
+#define f_eof(fp) ((int)((fp)->fptr == (fp)->fsize))
#define f_error(fp) ((fp)->err)
#define f_tell(fp) ((fp)->fptr)
#define f_size(fp) ((fp)->fsize)
@@ -252,7 +251,7 @@ TCHAR* f_gets (TCHAR* buff, int len, FIL* fp); /* Get a string from the fil
/* Additional user defined functions */
/* RTC function */
-#if !_FS_READONLY
+#if !_FS_READONLY && !_FS_NORTC
DWORD get_fattime (void);
#endif
diff --git a/fatfs/src/ffconf.h b/fatfs/src/ffconf.h
index d883c14..f968d7e 100644
--- a/fatfs/src/ffconf.h
+++ b/fatfs/src/ffconf.h
@@ -1,30 +1,30 @@
/*---------------------------------------------------------------------------/
-/ FatFs - FAT file system module configuration file R0.10b (C)ChaN, 2014
+/ FatFs - FAT file system module configuration file R0.10c (C)ChaN, 2014
/---------------------------------------------------------------------------*/
-#ifndef _FFCONF
-#define _FFCONF 8051 /* Revision ID */
-
+#define _FFCONF 80376 /* Revision ID */
/*---------------------------------------------------------------------------/
/ Functions and Buffer Configurations
/---------------------------------------------------------------------------*/
-#define _FS_TINY 0 /* 0:Normal or 1:Tiny */
-/* When _FS_TINY is set to 1, it reduces memory consumption _MAX_SS bytes each
-/ file object. For file data transfer, FatFs uses the common sector buffer in
-/ the file system object (FATFS) instead of private sector buffer eliminated
-/ from the file object (FIL). */
+#define _FS_TINY 0
+/* This option switches tiny buffer configuration. (0:Normal or 1:Tiny)
+/ At the tiny configuration, size of the file object (FIL) is reduced _MAX_SS
+/ bytes. Instead of private sector buffer eliminated from the file object,
+/ common sector buffer in the file system object (FATFS) is used for the file
+/ data transfer. */
-#define _FS_READONLY 0 /* 0:Read/Write or 1:Read only */
-/* Setting _FS_READONLY to 1 defines read only configuration. This removes
-/ writing functions, f_write(), f_sync(), f_unlink(), f_mkdir(), f_chmod(),
-/ f_rename(), f_truncate() and useless f_getfree(). */
+#define _FS_READONLY 0
+/* This option switches read-only configuration. (0:Read/Write or 1:Read-only)
+/ Read-only configuration removes basic writing API functions, f_write(),
+/ f_sync(), f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(),
+/ f_getfree() and optional writing functions as well. */
-#define _FS_MINIMIZE 0 /* 0 to 3 */
-/* The _FS_MINIMIZE option defines minimization level to remove API functions.
+#define _FS_MINIMIZE 0
+/* This option defines minimization level to remove some API functions.
/
/ 0: All basic functions are enabled.
/ 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_chmod(), f_utime(),
@@ -33,24 +33,32 @@
/ 3: f_lseek() function is removed in addition to 2. */
-#define _USE_STRFUNC 0 /* 0:Disable or 1-2:Enable */
-/* To enable string functions, set _USE_STRFUNC to 1 or 2. */
+#define _USE_STRFUNC 0
+/* This option switches string functions, f_gets(), f_putc(), f_puts() and
+/ f_printf().
+/
+/ 0: Disable string functions.
+/ 1: Enable without LF-CRLF conversion.
+/ 2: Enable with LF-CRLF conversion. */
-#define _USE_MKFS 0 /* 0:Disable or 1:Enable */
-/* To enable f_mkfs() function, set _USE_MKFS to 1 and set _FS_READONLY to 0 */
+#define _USE_MKFS 0
+/* This option switches f_mkfs() function. (0:Disable or 1:Enable)
+/ To enable it, also _FS_READONLY need to be set to 0. */
-#define _USE_FASTSEEK 0 /* 0:Disable or 1:Enable */
-/* To enable fast seek feature, set _USE_FASTSEEK to 1. */
+#define _USE_FASTSEEK 0
+/* This option switches fast seek feature. (0:Disable or 1:Enable) */
-#define _USE_LABEL 0 /* 0:Disable or 1:Enable */
-/* To enable volume label functions, set _USE_LAVEL to 1 */
+#define _USE_LABEL 0
+/* This option switches volume label functions, f_getlabel() and f_setlabel().
+/ (0:Disable or 1:Enable) */
-#define _USE_FORWARD 0 /* 0:Disable or 1:Enable */
-/* To enable f_forward() function, set _USE_FORWARD to 1 and set _FS_TINY to 1. */
+#define _USE_FORWARD 0
+/* This option switches f_forward() function. (0:Disable or 1:Enable) */
+/* To enable it, also _FS_TINY need to be set to 1. */
/*---------------------------------------------------------------------------/
@@ -58,7 +66,7 @@
/---------------------------------------------------------------------------*/
#define _CODE_PAGE 932
-/* The _CODE_PAGE specifies the OEM code page to be used on the target system.
+/* This option specifies the OEM code page to be used on the target system.
/ Incorrect setting of the code page can cause a file open failure.
/
/ 932 - Japanese Shift_JIS (DBCS, OEM, Windows)
@@ -86,11 +94,11 @@
/ 857 - Turkish (OEM)
/ 862 - Hebrew (OEM)
/ 874 - Thai (OEM, Windows)
-/ 1 - ASCII (Valid for only non-LFN configuration) */
+/ 1 - ASCII (No extended character. Valid for only non-LFN configuration.) */
-#define _USE_LFN 0 /* 0 to 3 */
-#define _MAX_LFN 255 /* Maximum LFN length to handle (12 to 255) */
+#define _USE_LFN 0
+#define _MAX_LFN 255
/* The _USE_LFN option switches the LFN feature.
/
/ 0: Disable LFN feature. _MAX_LFN has no effect.
@@ -98,35 +106,39 @@
/ 2: Enable LFN with dynamic working buffer on the STACK.
/ 3: Enable LFN with dynamic working buffer on the HEAP.
/
-/ When enable LFN feature, Unicode handling functions ff_convert() and ff_wtoupper()
-/ function must be added to the project.
-/ The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes. When use stack for the
-/ working buffer, take care on stack overflow. When use heap memory for the working
-/ buffer, memory management functions, ff_memalloc() and ff_memfree(), must be added
-/ to the project. */
+/ When enable the LFN feature, Unicode handling functions (option/unicode.c) must
+/ be added to the project. The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes.
+/ When use stack for the working buffer, take care on stack overflow. When use heap
+/ memory for the working buffer, memory management functions, ff_memalloc() and
+/ ff_memfree(), must be added to the project. */
-#define _LFN_UNICODE 0 /* 0:ANSI/OEM or 1:Unicode */
-/* To switch the character encoding on the FatFs API (TCHAR) to Unicode, enable LFN
-/ feature and set _LFN_UNICODE to 1. This option affects behavior of string I/O
-/ functions. This option must be 0 when LFN feature is not enabled. */
+#define _LFN_UNICODE 0
+/* This option switches character encoding on the API. (0:ANSI/OEM or 1:Unicode)
+/ To use Unicode string for the path name, enable LFN feature and set _LFN_UNICODE
+/ to 1. This option also affects behavior of string I/O functions. */
-#define _STRF_ENCODE 3 /* 0:ANSI/OEM, 1:UTF-16LE, 2:UTF-16BE, 3:UTF-8 */
-/* When Unicode API is enabled by _LFN_UNICODE option, this option selects the character
-/ encoding on the file to be read/written via string I/O functions, f_gets(), f_putc(),
-/ f_puts and f_printf(). This option has no effect when _LFN_UNICODE == 0. Note that
-/ FatFs supports only BMP. */
+#define _STRF_ENCODE 3
+/* When _LFN_UNICODE is 1, this option selects the character encoding on the file to
+/ be read/written via string I/O functions, f_gets(), f_putc(), f_puts and f_printf().
+/
+/ 0: ANSI/OEM
+/ 1: UTF-16LE
+/ 2: UTF-16BE
+/ 3: UTF-8
+/
+/ When _LFN_UNICODE is 0, this option has no effect. */
-#define _FS_RPATH 0 /* 0 to 2 */
-/* The _FS_RPATH option configures relative path feature.
+#define _FS_RPATH 0
+/* This option configures relative path feature.
/
/ 0: Disable relative path feature and remove related functions.
-/ 1: Enable relative path. f_chdrive() and f_chdir() function are available.
+/ 1: Enable relative path feature. f_chdir() and f_chdrive() are available.
/ 2: f_getcwd() function is available in addition to 1.
/
-/ Note that output of the f_readdir() fnction is affected by this option. */
+/ Note that directory items read via f_readdir() are affected by this option. */
/*---------------------------------------------------------------------------/
@@ -137,39 +149,43 @@
/* Number of volumes (logical drives) to be used. */
-#define _STR_VOLUME_ID 0 /* 0:Use only 0-9 for drive ID, 1:Use strings for drive ID */
+#define _STR_VOLUME_ID 0
#define _VOLUME_STRS "RAM","NAND","CF","SD1","SD2","USB1","USB2","USB3"
-/* When _STR_VOLUME_ID is set to 1, also pre-defined strings can be used as drive
-/ number in the path name. _VOLUME_STRS defines the drive ID strings for each logical
-/ drives. Number of items must be equal to _VOLUMES. Valid characters for the drive ID
-/ strings are: 0-9 and A-Z. */
+/* _STR_VOLUME_ID option switches string volume ID feature.
+/ When _STR_VOLUME_ID is set to 1, also pre-defined strings can be used as drive
+/ number in the path name. _VOLUME_STRS defines the drive ID strings for each
+/ logical drives. Number of items must be equal to _VOLUMES. Valid characters for
+/ the drive ID strings are: A-Z and 0-9. */
-#define _MULTI_PARTITION 0 /* 0:Single partition, 1:Enable multiple partition */
-/* By default(0), each logical drive number is bound to the same physical drive number
-/ and only a FAT volume found on the physical drive is mounted. When it is set to 1,
-/ each logical drive number is bound to arbitrary drive/partition listed in VolToPart[].
-*/
+#define _MULTI_PARTITION 0
+/* This option switches multi-partition feature. By default (0), each logical drive
+/ number is bound to the same physical drive number and only an FAT volume found on
+/ the physical drive will be mounted. When multi-partition feature is enabled (1),
+/ each logical drive number is bound to arbitrary physical drive and partition
+/ listed in the VolToPart[]. Also f_fdisk() funciton will be enabled. */
#define _MIN_SS 512
#define _MAX_SS 512
-/* These options configure the range of sector size to be supported. (512, 1024, 2048 or
-/ 4096) Always set both 512 for most systems, all memory card and harddisk. But a larger
-/ value may be required for on-board flash memory and some type of optical media.
-/ When _MAX_SS is larger than _MIN_SS, FatFs is configured to variable sector size and
-/ GET_SECTOR_SIZE command must be implemented to the disk_ioctl() function. */
+/* These options configure the range of sector size to be supported. (512, 1024,
+/ 2048 or 4096) Always set both 512 for most systems, all type of memory cards and
+/ harddisk. But a larger value may be required for on-board flash memory and some
+/ type of optical media. When _MAX_SS is larger than _MIN_SS, FatFs is configured
+/ to variable sector size and GET_SECTOR_SIZE command must be implemented to the
+/ disk_ioctl() function. */
-#define _USE_ERASE 0 /* 0:Disable or 1:Enable */
-/* To enable sector erase feature, set _USE_ERASE to 1. Also CTRL_ERASE_SECTOR command
-/ should be added to the disk_ioctl() function. */
+#define _USE_TRIM 0
+/* This option switches ATA-TRIM feature. (0:Disable or 1:Enable)
+/ To enable Trim feature, also CTRL_TRIM command should be implemented to the
+/ disk_ioctl() function. */
-#define _FS_NOFSINFO 0 /* 0 to 3 */
-/* If you need to know correct free space on the FAT32 volume, set bit 0 of this option
-/ and f_getfree() function at first time after volume mount will force a full FAT scan.
-/ Bit 1 controls the last allocated cluster number as bit 0.
+#define _FS_NOFSINFO 0
+/* If you need to know correct free space on the FAT32 volume, set bit 0 of this
+/ option, and f_getfree() function at first time after volume mount will force
+/ a full FAT scan. Bit 1 controls the use of last allocated cluster number.
/
/ bit0=0: Use free cluster count in the FSINFO if available.
/ bit0=1: Do not trust free cluster count in the FSINFO.
@@ -183,46 +199,72 @@
/ System Configurations
/---------------------------------------------------------------------------*/
-#define _FS_LOCK 0 /* 0:Disable or >=1:Enable */
-/* To enable file lock control feature, set _FS_LOCK to non-zero value.
-/ The value defines how many files/sub-directories can be opened simultaneously
-/ with file lock control. This feature uses bss _FS_LOCK * 12 bytes. */
-
-
-#define _FS_REENTRANT 0 /* 0:Disable or 1:Enable */
-#define _FS_TIMEOUT 1000 /* Timeout period in unit of time tick */
-#define _SYNC_t HANDLE /* O/S dependent sync object type. e.g. HANDLE, OS_EVENT*, ID, SemaphoreHandle_t and etc.. */
-/* The _FS_REENTRANT option switches the re-entrancy (thread safe) of the FatFs module.
+#define _FS_NORTC 0
+#define _NORTC_MON 11
+#define _NORTC_MDAY 9
+#define _NORTC_YEAR 2014
+/* The _FS_NORTC option switches timestamp feature. If the system does not have
+/ an RTC function or valid timestamp is not needed, set _FS_NORTC to 1 to disable
+/ the timestamp feature. All objects modified by FatFs will have a fixed timestamp
+/ defined by _NORTC_MON, _NORTC_MDAY and _NORTC_YEAR.
+/ When timestamp feature is enabled (_FS_NORTC == 0), get_fattime() function need
+/ to be added to the project to read current time form RTC. _NORTC_MON,
+/ _NORTC_MDAY and _NORTC_YEAR have no effect.
+/ These options have no effect at read-only configuration (_FS_READONLY == 1). */
+
+
+#define _FS_LOCK 0
+/* The _FS_LOCK option switches file lock feature to control duplicated file open
+/ and illegal operation to open objects. This option must be 0 when _FS_READONLY
+/ is 1.
+/
+/ 0: Disable file lock feature. To avoid volume corruption, application program
+/ should avoid illegal open, remove and rename to the open objects.
+/ >0: Enable file lock feature. The value defines how many files/sub-directories
+/ can be opened simultaneously under file lock control. Note that the file
+/ lock feature is independent of re-entrancy. */
+
+
+#define _FS_REENTRANT 0
+#define _FS_TIMEOUT 1000
+#define _SYNC_t HANDLE
+/* The _FS_REENTRANT option switches the re-entrancy (thread safe) of the FatFs
+/ module itself. Note that regardless of this option, file access to different
+/ volume is always re-entrant and volume control functions, f_mount(), f_mkfs()
+/ and f_fdisk() function, are always not re-entrant. Only file/directory access
+/ to the same volume is under control of this feature.
/
/ 0: Disable re-entrancy. _FS_TIMEOUT and _SYNC_t have no effect.
/ 1: Enable re-entrancy. Also user provided synchronization handlers,
/ ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj()
-/ function must be added to the project.
-*/
+/ function, must be added to the project. Samples are available in
+/ option/syscall.c.
+/
+/ The _FS_TIMEOUT defines timeout period in unit of time tick.
+/ The _SYNC_t defines O/S dependent sync object type. e.g. HANDLE, ID, OS_EVENT*,
+/ SemaphoreHandle_t and etc.. */
-#define _WORD_ACCESS 0 /* 0 or 1 */
+#define _WORD_ACCESS 0
/* The _WORD_ACCESS option is an only platform dependent option. It defines
/ which access method is used to the word data on the FAT volume.
/
/ 0: Byte-by-byte access. Always compatible with all platforms.
/ 1: Word access. Do not choose this unless under both the following conditions.
/
-/ * Address misaligned memory access is always allowed for ALL instructions.
+/ * Address misaligned memory access is always allowed to ALL instructions.
/ * Byte order on the memory is little-endian.
/
-/ If it is the case, _WORD_ACCESS can also be set to 1 to improve performance and
-/ reduce code size. Following table shows an example of some processor types.
+/ If it is the case, _WORD_ACCESS can also be set to 1 to reduce code size.
+/ Following table shows allowable settings of some processor types.
/
/ ARM7TDMI 0 ColdFire 0 V850E 0
/ Cortex-M3 0 Z80 0/1 V850ES 0/1
-/ Cortex-M0 0 RX600(LE) 0/1 TLCS-870 0/1
-/ AVR 0/1 RX600(BE) 0 TLCS-900 0/1
+/ Cortex-M0 0 x86 0/1 TLCS-870 0/1
+/ AVR 0/1 RX600(LE) 0/1 TLCS-900 0/1
/ AVR32 0 RL78 0 R32C 0
/ PIC18 0/1 SH-2 0 M16C 0/1
/ PIC24 0 H8S 0 MSP430 0
-/ PIC32 0 H8/300H 0 x86 0/1
+/ PIC32 0 H8/300H 0 8051 0/1
*/
-
-#endif /* _FFCONF */
diff --git a/fatfs/src/option/cc932.c b/fatfs/src/option/cc932.c
index 26ac70f..36db384 100644
--- a/fatfs/src/option/cc932.c
+++ b/fatfs/src/option/cc932.c
@@ -3739,10 +3739,10 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
#if !_TINY_TABLE
if (dir) { /* OEMCP to unicode */
p = sjis2uni;
- hi = sizeof(sjis2uni) / 4 - 1;
+ hi = sizeof sjis2uni / 4 - 1;
} else { /* Unicode to OEMCP */
p = uni2sjis;
- hi = sizeof(uni2sjis) / 4 - 1;
+ hi = sizeof uni2sjis / 4 - 1;
}
li = 0;
for (n = 16; n; n--) {
@@ -3764,7 +3764,7 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
p -= 3;
c = *p;
} else { /* Unicode to OEMCP */
- li = 0; hi = sizeof(uni2sjis) / 4 - 1;
+ li = 0; hi = sizeof uni2sjis / 4 - 1;
for (n = 16; n; n--) {
i = li + (hi - li) / 2;
if (chr == uni2sjis[i * 2]) break;
diff --git a/fatfs/src/option/cc936.c b/fatfs/src/option/cc936.c
index 07a7c1c..84bc329 100644
--- a/fatfs/src/option/cc936.c
+++ b/fatfs/src/option/cc936.c
@@ -10936,10 +10936,10 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
} else {
if (dir) { /* OEMCP to unicode */
p = oem2uni;
- hi = sizeof(oem2uni) / 4 - 1;
+ hi = sizeof oem2uni / 4 - 1;
} else { /* Unicode to OEMCP */
p = uni2oem;
- hi = sizeof(uni2oem) / 4 - 1;
+ hi = sizeof uni2oem / 4 - 1;
}
li = 0;
for (n = 16; n; n--) {
diff --git a/fatfs/src/option/cc949.c b/fatfs/src/option/cc949.c
index 1fd075d..0abda85 100644
--- a/fatfs/src/option/cc949.c
+++ b/fatfs/src/option/cc949.c
@@ -8565,10 +8565,10 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
} else {
if (dir) { /* OEMCP to unicode */
p = oem2uni;
- hi = sizeof(oem2uni) / 4 - 1;
+ hi = sizeof oem2uni / 4 - 1;
} else { /* Unicode to OEMCP */
p = uni2oem;
- hi = sizeof(uni2oem) / 4 - 1;
+ hi = sizeof uni2oem / 4 - 1;
}
li = 0;
for (n = 16; n; n--) {
diff --git a/fatfs/src/option/cc950.c b/fatfs/src/option/cc950.c
index a3c9c44..d914b6d 100644
--- a/fatfs/src/option/cc950.c
+++ b/fatfs/src/option/cc950.c
@@ -6791,10 +6791,10 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
} else {
if (dir) { /* OEMCP to unicode */
p = oem2uni;
- hi = sizeof(oem2uni) / 4 - 1;
+ hi = sizeof oem2uni / 4 - 1;
} else { /* Unicode to OEMCP */
p = uni2oem;
- hi = sizeof(uni2oem) / 4 - 1;
+ hi = sizeof uni2oem / 4 - 1;
}
li = 0;
for (n = 16; n; n--) {
diff --git a/fatfs/src/option/ccsbcs.c b/fatfs/src/option/ccsbcs.c
index d6897bc..b16db30 100644
--- a/fatfs/src/option/ccsbcs.c
+++ b/fatfs/src/option/ccsbcs.c
@@ -444,7 +444,7 @@ const WCHAR Tbl[] = { /* CP1256(0x80-0xFF) to Unicode conversion table */
0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0649, 0x064A, 0x00EE, 0x00EF,
0x064B, 0x064C, 0x064D, 0x064E, 0x00F4, 0x064F, 0x0650, 0x00F7,
0x0651, 0x00F9, 0x0652, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x06D2
-}
+};
#elif _CODE_PAGE == 1257
#define _TBLDEF 1
diff --git a/fatfs/src/option/syscall.c b/fatfs/src/option/syscall.c
index ccfd47e..2036cb7 100644
--- a/fatfs/src/option/syscall.c
+++ b/fatfs/src/option/syscall.c
@@ -1,10 +1,8 @@
/*------------------------------------------------------------------------*/
/* Sample code of OS dependent controls for FatFs */
-/* (C)ChaN, 2012 */
+/* (C)ChaN, 2014 */
/*------------------------------------------------------------------------*/
-#include <stdlib.h> /* ANSI memory controls */
-#include <malloc.h> /* ANSI memory controls */
#include "../ff.h"
@@ -13,14 +11,14 @@
/*------------------------------------------------------------------------*/
/* Create a Synchronization Object
/*------------------------------------------------------------------------*/
-/* This function is called by f_mount() function to create a new
-/ synchronization object, such as semaphore and mutex. When a 0 is
-/ returned, the f_mount() function fails with FR_INT_ERR.
+/* This function is called in f_mount() function to create a new
+/ synchronization object, such as semaphore and mutex. When a 0 is returned,
+/ the f_mount() function fails with FR_INT_ERR.
*/
-int ff_cre_syncobj ( /* 1:Function succeeded, 0:Could not create due to any error */
+int ff_cre_syncobj ( /* !=0:Function succeeded, ==0:Could not create due to any error */
BYTE vol, /* Corresponding logical drive being processed */
- _SYNC_t* sobj /* Pointer to return the created sync object */
+ _SYNC_t *sobj /* Pointer to return the created sync object */
)
{
int ret;
@@ -29,13 +27,13 @@ int ff_cre_syncobj ( /* 1:Function succeeded, 0:Could not create due to any erro
*sobj = CreateMutex(NULL, FALSE, NULL); /* Win32 */
ret = (int)(*sobj != INVALID_HANDLE_VALUE);
-// *sobj = SyncObjects[vol]; /* uITRON (give a static created semaphore) */
-// ret = 1;
+// *sobj = SyncObjects[vol]; /* uITRON (give a static created sync object) */
+// ret = 1; /* The initial value of the semaphore must be 1. */
-// *sobj = OSMutexCreate(0, &err); /* uC/OS-II */
+// *sobj = OSMutexCreate(0, &err); /* uC/OS-II */
// ret = (int)(err == OS_NO_ERR);
-// *sobj = xSemaphoreCreateMutex(); /* FreeRTOS */
+// *sobj = xSemaphoreCreateMutex(); /* FreeRTOS */
// ret = (int)(*sobj != NULL);
return ret;
@@ -47,11 +45,11 @@ int ff_cre_syncobj ( /* 1:Function succeeded, 0:Could not create due to any erro
/* Delete a Synchronization Object */
/*------------------------------------------------------------------------*/
/* This function is called in f_mount() function to delete a synchronization
-/ object that created with ff_cre_syncobj() function. When a 0 is
-/ returned, the f_mount() function fails with FR_INT_ERR.
+/ object that created with ff_cre_syncobj function. When a 0 is returned,
+/ the f_mount() function fails with FR_INT_ERR.
*/
-int ff_del_syncobj ( /* 1:Function succeeded, 0:Could not delete due to any error */
+int ff_del_syncobj ( /* !=0:Function succeeded, ==0:Could not delete due to any error */
_SYNC_t sobj /* Sync object tied to the logical drive to be deleted */
)
{
@@ -65,7 +63,7 @@ int ff_del_syncobj ( /* 1:Function succeeded, 0:Could not delete due to any erro
// OSMutexDel(sobj, OS_DEL_ALWAYS, &err); /* uC/OS-II */
// ret = (int)(err == OS_NO_ERR);
-// xSemaphoreDelete(sobj); /* FreeRTOS */
+// vSemaphoreDelete(sobj); /* FreeRTOS */
// ret = 1;
return ret;
@@ -77,10 +75,10 @@ int ff_del_syncobj ( /* 1:Function succeeded, 0:Could not delete due to any erro
/* Request Grant to Access the Volume */
/*------------------------------------------------------------------------*/
/* This function is called on entering file functions to lock the volume.
-/ When a FALSE is returned, the file function fails with FR_TIMEOUT.
+/ When a 0 is returned, the file function fails with FR_TIMEOUT.
*/
-int ff_req_grant ( /* TRUE:Got a grant to access the volume, FALSE:Could not get a grant */
+int ff_req_grant ( /* 1:Got a grant to access the volume, 0:Could not get a grant */
_SYNC_t sobj /* Sync object to wait */
)
{
@@ -135,7 +133,7 @@ void* ff_memalloc ( /* Returns pointer to the allocated memory block */
UINT msize /* Number of bytes to allocate */
)
{
- return malloc(msize);
+ return malloc(msize); /* Allocate a new memory block with POSIX API */
}
@@ -147,7 +145,7 @@ void ff_memfree (
void* mblock /* Pointer to the memory block to free */
)
{
- free(mblock);
+ free(mblock); /* Discard the memory block with POSIX API */
}
#endif