close.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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/close.html">
  8. <link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
  9. <title>FatFs - f_close</title>
  10. </head>
  11. <body>
  12. <div class="para func">
  13. <h2>f_close</h2>
  14. <p>The f_close function closes an open file.</p>
  15. <pre>
  16. FRESULT f_close (
  17. FIL* <span class="arg">fp</span> <span class="c">/* [IN] Pointer to the file object */</span>
  18. );
  19. </pre>
  20. </div>
  21. <div class="para arg">
  22. <h4>Parameter</h4>
  23. <dl class="par">
  24. <dt>fp</dt>
  25. <dd>Pointer to the open file object structure to be closed.</dd>
  26. </dl>
  27. </div>
  28. <div class="para ret">
  29. <h4>Return Values</h4>
  30. <p>
  31. <a href="rc.html#ok">FR_OK</a>,
  32. <a href="rc.html#de">FR_DISK_ERR</a>,
  33. <a href="rc.html#ie">FR_INT_ERR</a>,
  34. <a href="rc.html#nr">FR_NOT_READY</a>,
  35. <a href="rc.html#io">FR_INVALID_OBJECT</a>,
  36. <a href="rc.html#tm">FR_TIMEOUT</a>
  37. </p>
  38. </div>
  39. <div class="para desc">
  40. <h4>Description</h4>
  41. <p>The <tt>f_close()</tt> function closes an open file object. If any data has been written to the file, the cached information of the file is written back to the volume. After the function succeeded, the file object is no longer valid and it can be discarded.</p>
  42. <p>Note that if the file object is in read-only mode and <tt>_FS_LOCK</tt> option is not enabled, the file object can also be discarded without this process. However this is not recommended for future compatibility.</p>
  43. </div>
  44. <div class="para comp">
  45. <h4>QuickInfo</h4>
  46. <p>Always available.</p>
  47. </div>
  48. <div class="para ref">
  49. <h4>See Also</h4>
  50. <p><tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="write.html">f_write</a>, <a href="sync.html">f_sync</a>, <a href="sfile.html">FIL</a>, <a href="sfatfs.html">FATFS</a></tt></p>
  51. </div>
  52. <p class="foot"><a href="../00index_e.html">Return</a></p>
  53. </body>
  54. </html>