]> git.sur5r.net Git - freertos/blob - Demo/Common/FileSystem/FatFs-0.7e/doc/en/chmod.html
Start to re-arrange files to include FreeRTOS+ in main download.
[freertos] / Demo / Common / FileSystem / FatFs-0.7e / doc / en / chmod.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
2 <html lang="en">\r
3 <head>\r
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
5 <meta http-equiv="Content-Style-Type" content="text/css">\r
6 <link rel="up" title="FatFs" href="../00index_e.html">\r
7 <link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">\r
8 <title>FatFs - f_chmod</title>\r
9 </head>\r
10 \r
11 <body>\r
12 \r
13 <div class="para">\r
14 <h2>f_chmod</h2>\r
15 <p>The f_chmod function changes the attribute of a file or directory.</p>\r
16 <pre>\r
17 FRESULT f_chmod (\r
18   const XCHAR* <em>FileName</em>, /* Pointer to the file or directory */\r
19   BYTE <em>Attribute</em>,        /* Attribute flags */\r
20   BYTE <em>AttributeMask</em>     /* Attribute masks */\r
21 );\r
22 </pre>\r
23 </div>\r
24 \r
25 <div class="para">\r
26 <h4>Parameters</h4>\r
27 <dl class="par">\r
28 <dt>FileName</dt>\r
29 <dd>Pointer to the null-terminated string that specifies a <a href="filename.html">file or directory</a> to be changed</dd>\r
30 <dt>Attribute</dt>\r
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>\r
32 <table class="lst">\r
33 <tr><th>Attribute</th><th>Description</th></tr>\r
34 <tr><td>AM_RDO</td><td>Read only</td></tr>\r
35 <tr><td>AM_ARC</td><td>Archive</td></tr>\r
36 <tr><td>AM_SYS</td><td>System</td></tr>\r
37 <tr><td>AM_HID</td><td>Hidden</td></tr>\r
38 </table>\r
39 </dd>\r
40 <dt>AttributeMask</dt>\r
41 <dd>Attribute mask that specifies which attribute is changed. The specified aattributes are set or cleard.</dd>\r
42 </dl>\r
43 </div>\r
44 \r
45 \r
46 <div class="para">\r
47 <h4>Return Values</h4>\r
48 <dl class="ret">\r
49 <dt>FR_OK (0)</dt>\r
50 <dd>The function succeeded.</dd>\r
51 <dt>FR_NO_FILE</dt>\r
52 <dd>Could not find the file.</dd>\r
53 <dt>FR_NO_PATH</dt>\r
54 <dd>Could not find the path.</dd>\r
55 <dt>FR_INVALID_NAME</dt>\r
56 <dd>The file name is invalid.</dd>\r
57 <dt>FR_INVALID_DRIVE</dt>\r
58 <dd>The drive number is invalid.</dd>\r
59 <dt>FR_NOT_READY</dt>\r
60 <dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>\r
61 <dt>FR_WRITE_PROTECTED</dt>\r
62 <dd>The medium is write protected.</dd>\r
63 <dt>FR_DISK_ERR</dt>\r
64 <dd>The function failed due to an error in the disk function.</dd>\r
65 <dt>FR_INT_ERR</dt>\r
66 <dd>The function failed due to a wrong FAT structure or an internal error.</dd>\r
67 <dt>FR_NOT_ENABLED</dt>\r
68 <dd>The logical drive has no work area.</dd>\r
69 <dt>FR_NO_FILESYSTEM</dt>\r
70 <dd>There is no valid FAT volume on the disk.</dd>\r
71 </dl>\r
72 </div>\r
73 \r
74 \r
75 <div class="para">\r
76 <h4>Description</h4>\r
77 <p>The f_chmod function changes the attribute of a file or directory.</p>\r
78 </div>\r
79 \r
80 \r
81 <div class="para">\r
82 <h4>QuickInfo</h4>\r
83 <p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>\r
84 </div>\r
85 \r
86 \r
87 <div class="para">\r
88 <h4>Example</h4>\r
89 <pre>\r
90     // Set read-only flag, clear archive flag and others are retained.\r
91     f_chmod("file.txt", AR_RDO, AR_RDO | AR_ARC);\r
92 </pre>\r
93 </div>\r
94 \r
95 <p class="foot"><a href="../00index_e.html">Return</a></p>\r
96 </body>\r
97 </html>\r