chmod.html 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html lang="en">
  3. <head>
  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="alternate" hreflang="ja" title="Japanese" href="../ja/chmod.html">
  8. <link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
  9. <title>FatFs - f_chmod</title>
  10. </head>
  11. <body>
  12. <div class="para func">
  13. <h2>f_chmod</h2>
  14. <p>The f_chmod function changes the attribute of a file or sub-directory.</p>
  15. <pre>
  16. FRESULT f_chmod (
  17. const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] Object name */</span>
  18. BYTE <span class="arg">attr</span>, <span class="c">/* [IN] Attribute flags */</span>
  19. BYTE <span class="arg">mask</span> <span class="c">/* [IN] Attribute masks */</span>
  20. );
  21. </pre>
  22. </div>
  23. <div class="para arg">
  24. <h4>Parameters</h4>
  25. <dl class="par">
  26. <dt>path</dt>
  27. <dd>Pointer to the null-terminated string that specifies an <a href="filename.html">object</a> to be changed</dd>
  28. <dt>attr</dt>
  29. <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>
  30. <table class="lst">
  31. <tr><th>Attribute</th><th>Description</th></tr>
  32. <tr><td>AM_RDO</td><td>Read only</td></tr>
  33. <tr><td>AM_ARC</td><td>Archive</td></tr>
  34. <tr><td>AM_SYS</td><td>System</td></tr>
  35. <tr><td>AM_HID</td><td>Hidden</td></tr>
  36. </table>
  37. </dd>
  38. <dt>mask</dt>
  39. <dd>Attribute mask that specifies which attribute is changed. The specified attributes are set or cleard and others are left unchanged.</dd>
  40. </dl>
  41. </div>
  42. <div class="para ret">
  43. <h4>Return Values</h4>
  44. <p>
  45. <a href="rc.html#ok">FR_OK</a>,
  46. <a href="rc.html#de">FR_DISK_ERR</a>,
  47. <a href="rc.html#ie">FR_INT_ERR</a>,
  48. <a href="rc.html#nr">FR_NOT_READY</a>,
  49. <a href="rc.html#ok">FR_NO_FILE</a>,
  50. <a href="rc.html#np">FR_NO_PATH</a>,
  51. <a href="rc.html#in">FR_INVALID_NAME</a>,
  52. <a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
  53. <a href="rc.html#id">FR_INVALID_DRIVE</a>,
  54. <a href="rc.html#ne">FR_NOT_ENABLED</a>,
  55. <a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
  56. <a href="rc.html#tm">FR_TIMEOUT</a>,
  57. <a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
  58. </p>
  59. </div>
  60. <div class="para desc">
  61. <h4>Description</h4>
  62. <p>The <tt>f_chmod()</tt> function changes the attribute of a file or sub-directory.</p>
  63. </div>
  64. <div class="para comp">
  65. <h4>QuickInfo</h4>
  66. <p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>
  67. </div>
  68. <div class="para use">
  69. <h4>Example</h4>
  70. <pre>
  71. <span class="c">/* Set read-only flag, clear archive flag and others are left unchanged. */</span>
  72. f_chmod("file.txt", AR_RDO, AR_RDO | AR_ARC);
  73. </pre>
  74. </div>
  75. <p class="foot"><a href="../00index_e.html">Return</a></p>
  76. </body>
  77. </html>