1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
5 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
6 <link rel=
"up" title=
"FatFs" href=
"../00index_j.html">
7 <link rel=
"alternate" hreflang=
"en" title=
"English" href=
"../en/rename.html">
8 <link rel=
"stylesheet" href=
"../css_j.css" type=
"text/css" media=
"screen" title=
"ELM Default">
9 <title>FatFs - f_rename
</title>
14 <div class=
"para func">
16 <p>ファイルまたはサブ ディレクトリの名前の変更または移動します。
</p>
19 const TCHAR*
<span class=
"arg">old_name
</span>,
<span class=
"c">/* [IN] 古いオブジェクト名 */
</span>
20 const TCHAR*
<span class=
"arg">new_name
</span> <span class=
"c">/* [IN] 新しいオブジェクト名 */
</span>
25 <div class=
"para arg">
29 <dd>変更対象のファイルまたはサブ ディレクトリの
<a href=
"filename.html">パス名
</a>を示すヌル文字
<tt>'\
0'
</tt>終端の文字列へのポインタを指定します。
</dd>
31 <dd>新しいパス名を示すヌル文字
<tt>'\
0'
</tt>終端の文字列へのポインタを指定します。また、ドライブ番号は指定しても無視され、
<tt class=
"arg">old_name
</tt>で決められたボリューム上のオブジェクトとして扱われます。これと同じパス名(
<tt class=
"arg">old_name
</tt>は除く)のオブジェクトが存在すると、関数は
<tt>FR_EXIST
</tt>で失敗します。
</dd>
36 <div class=
"para ret">
39 <a href=
"rc.html#ok">FR_OK
</a>,
40 <a href=
"rc.html#de">FR_DISK_ERR
</a>,
41 <a href=
"rc.html#ie">FR_INT_ERR
</a>,
42 <a href=
"rc.html#nr">FR_NOT_READY
</a>,
43 <a href=
"rc.html#ok">FR_NO_FILE
</a>,
44 <a href=
"rc.html#np">FR_NO_PATH
</a>,
45 <a href=
"rc.html#in">FR_INVALID_NAME
</a>,
46 <a href=
"rc.html#ex">FR_EXIST
</a>,
47 <a href=
"rc.html#wp">FR_WRITE_PROTECTED
</a>,
48 <a href=
"rc.html#id">FR_INVALID_DRIVE
</a>,
49 <a href=
"rc.html#ne">FR_NOT_ENABLED
</a>,
50 <a href=
"rc.html#ns">FR_NO_FILESYSTEM
</a>,
51 <a href=
"rc.html#tm">FR_TIMEOUT
</a>,
52 <a href=
"rc.html#lo">FR_LOCKED
</a>
57 <div class=
"para desc">
59 <p>ファイルまたはサブ ディレクトリの名前を変更します。また、同時に別のディレクトリへの移動も可能ですが、異なるドライブ間の移動はできません。開かれているオブジェクトに対する使用は不正な操作となり、
<em>FAT構造が破壊される可能性
</em>があります。
<a href=
"appnote.html#dup">多重アクセス制御
</a>が有効のときは安全に拒否されます。
</p>
63 <div class=
"para comp">
65 <p><tt>_FS_READONLY ==
0</tt>で、且つ
<tt>_FS_MINIMIZE ==
0</tt>のときに使用可能です。
</p>
69 <div class=
"para use">
72 <span class=
"c">/* デフォルト ドライブにあるオブジェクトの名前を変更 */
</span>
73 f_rename(
"oldname.txt",
"newname.txt");
75 <span class=
"c">/* ドライブ
2にあるオブジェクトの名前を変更 */
</span>
76 f_rename(
"2:oldname.txt",
"newname.txt");
78 <span class=
"c">/* 名前の変更と同時に別のディレクトリに移動 */
</span>
79 f_rename(
"log.txt",
"old/log0001.txt");
83 <p class=
"foot"><a href=
"../00index_j.html">戻る
</a></p>