fatfs v0.03 Sep 22, 2006:
- Added f_rename(). - Changed option _FS_MINIMUM to _FS_MINIMIZE.
This commit is contained in:
1 parent
86d6ced87e
commit
9a43e8b517
33 files changed
+926
-616
No files matched your search
+6
-6
@@ -49,9 +49,9 @@ FRESULT f_open (
|
||||
<dl class="ret">
|
||||
<dt>FR_OK (0)</dt>
|
||||
<dd>正常終了。以降、<tt><em>FileObject</em></tt>構造体を使ってこのファイルを操作できます。ファイルを閉じるときは、<tt><a href="close.html">f_close()</a></tt>を使用します。</dd>
|
||||
<dt>FR_NOFILE</dt>
|
||||
<dt>FR_NO_FILE</dt>
|
||||
<dd>ファイルが見つからない。</dd>
|
||||
<dt>FR_NOPATH</dt>
|
||||
<dt>FR_NO_PATH</dt>
|
||||
<dd>パスが見つからない。</dd>
|
||||
<dt>FR_INVALID_NAME</dt>
|
||||
<dd>ファイル名が不正。</dd>
|
||||
@@ -97,19 +97,19 @@ void main ()
|
||||
FatFs = &fs;
|
||||
|
||||
// ソース・ファイルを開く
|
||||
res = f_open(&fsrc, "/srcfile.dat", FA_OPEN_EXISTING | FA_READ);
|
||||
res = f_open(&fsrc, "srcfile.dat", FA_OPEN_EXISTING | FA_READ);
|
||||
if (res) die(res);
|
||||
|
||||
// デスティネーション・ファイルを作成する
|
||||
res = f_open(&fdst, "/dstfile.dat", FA_CREATE_ALWAYS | FA_WRITE);
|
||||
res = f_open(&fdst, "dstfile.dat", FA_CREATE_ALWAYS | FA_WRITE);
|
||||
if (res) die(res);
|
||||
|
||||
// ソースからデスティネーションにコピーする
|
||||
for (;;) {
|
||||
res = f_read(&fsrc, buffer, sizeof(buffer), &br);
|
||||
if (res || br == 0) break;
|
||||
if (res || br == 0) break; // error or eof
|
||||
res = f_write(&fdst, buffer, br, &bw);
|
||||
if (res || bw < br) break;
|
||||
if (res || bw < br) break; // error or disk full
|
||||
}
|
||||
|
||||
// 全てのファイルを閉じる
|
||||
|
||||
Reference in new issue
Block a user