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=iso-8859-1">
5 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
6 <link rel=
"up" title=
"FatFs" href=
"../00index_e.html">
7 <link rel=
"stylesheet" href=
"../css_e.css" type=
"text/css" media=
"screen" title=
"ELM Default">
8 <title>FatFs - f_chmod
</title>
15 <p>The f_chmod function changes the attribute of a file or directory.
</p>
18 const XCHAR*
<em>FileName
</em>, /* Pointer to the file or directory */
19 BYTE
<em>Attribute
</em>, /* Attribute flags */
20 BYTE
<em>AttributeMask
</em> /* Attribute masks */
29 <dd>Pointer to the null-terminated string that specifies a
<a href=
"filename.html">file or directory
</a> to be changed
</dd>
31 <dd>Attribute flags to be set in one or more combination of the following flags. The specified flags are set and others are cleard.
<br>
33 <tr><th>Attribute
</th><th>Description
</th></tr>
34 <tr><td>AM_RDO
</td><td>Read only
</td></tr>
35 <tr><td>AM_ARC
</td><td>Archive
</td></tr>
36 <tr><td>AM_SYS
</td><td>System
</td></tr>
37 <tr><td>AM_HID
</td><td>Hidden
</td></tr>
40 <dt>AttributeMask
</dt>
41 <dd>Attribute mask that specifies which attribute is changed. The specified aattributes are set or cleard.
</dd>
47 <h4>Return Values
</h4>
50 <dd>The function succeeded.
</dd>
52 <dd>Could not find the file.
</dd>
54 <dd>Could not find the path.
</dd>
55 <dt>FR_INVALID_NAME
</dt>
56 <dd>The file name is invalid.
</dd>
57 <dt>FR_INVALID_DRIVE
</dt>
58 <dd>The drive number is invalid.
</dd>
60 <dd>The disk drive cannot work due to no medium in the drive or any other reason.
</dd>
61 <dt>FR_WRITE_PROTECTED
</dt>
62 <dd>The medium is write protected.
</dd>
64 <dd>The function failed due to an error in the disk function.
</dd>
66 <dd>The function failed due to a wrong FAT structure or an internal error.
</dd>
67 <dt>FR_NOT_ENABLED
</dt>
68 <dd>The logical drive has no work area.
</dd>
69 <dt>FR_NO_FILESYSTEM
</dt>
70 <dd>There is no valid FAT volume on the disk.
</dd>
77 <p>The f_chmod function changes the attribute of a file or directory.
</p>
83 <p>Available when
<tt>_FS_READONLY ==
0</tt> and
<tt>_FS_MINIMIZE ==
0</tt>.
</p>
90 // Set read-only flag, clear archive flag and others are retained.
91 f_chmod(
"file.txt", AR_RDO, AR_RDO | AR_ARC);
95 <p class=
"foot"><a href=
"../00index_e.html">Return
</a></p>