sfile.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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/sfile.html">
  8. <link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
  9. <title>FatFs - FIL</title>
  10. </head>
  11. <body>
  12. <div class="para">
  13. <h2>FIL</h2>
  14. <p>The <tt>FIL</tt> structure (file object) holds state of an open file. It is created by <tt>f_open()</tt> function and discarded by <tt>f_close()</tt> function. Application program must not modify any member in this structure except for <tt>cltbl</tt>. Note that a sector buffer is defined in this structure at non-tiny configuration, so that the <tt>FIL</tt> structures should not be defined as auto variable.</p>
  15. <pre>
  16. <span class="k">typedef</span> <span class="k">struct</span> {
  17. FATFS* fs; <span class="c">/* Pointer to the owner file system object */</span>
  18. WORD id; <span class="c">/* Owner file system mount ID */</span>
  19. BYTE flag; <span class="c">/* File object status flags */</span>
  20. BYTE err; <span class="c">/* Abort flag (error code) */</span>
  21. DWORD fptr; <span class="c">/* File read/write pointer (Byte offset origin from top of the file) */</span>
  22. DWORD fsize; <span class="c">/* File size in unit of byte */</span>
  23. DWORD sclust; <span class="c">/* File start cluster */</span>
  24. DWORD clust; <span class="c">/* Current cluster */</span>
  25. DWORD dsect; <span class="c">/* Current data sector */</span>
  26. <span class="k">#if</span> !_FS_READONLY
  27. DWORD dir_sect; <span class="c">/* Sector containing the directory entry */</span>
  28. BYTE* dir_ptr; <span class="c">/* Ponter to the directory entry in the window */</span>
  29. <span class="k">#endif</span>
  30. <span class="k">#if</span> _USE_FASTSEEK
  31. DWORD* cltbl; <span class="c">/* Pointer to the cluster link map table (Nulled on file open) */</span>
  32. <span class="k">#endif</span>
  33. <span class="k">#if</span> _FS_LOCK
  34. UINT lockid; <span class="c">/* Fle lock ID */</span>
  35. <span class="k">#endif</span>
  36. <span class="k">#if</span> !_FS_TINY
  37. BYTE buf[_MAX_SS]; <span class="c">/* File private data transfer buffer */</span>
  38. <span class="k">#endif</span>
  39. } FIL;
  40. </pre>
  41. </div>
  42. <p class="foot"><a href="../00index_e.html">Return</a></p>
  43. </body>
  44. </html>