sfile.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 the 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>, or any data on the FAT volume can be collapsed. Note that a sector buffer is defined in this structure at non-tiny configuration (<tt>_FS_TINY == 0</tt>), so that the <tt>FIL</tt> structures at that configuration should not be defined as auto variable.</p>
  15. <pre>
  16. <span class="k">typedef</span> <span class="k">struct</span> {
  17. _FDID obj; <span class="c">/* Owner file sytem object and object identifier */</span>
  18. BYTE flag; <span class="c">/* File object status flags */</span>
  19. BYTE err; <span class="c">/* Abort flag (error code) */</span>
  20. FSIZE_t fptr; <span class="c">/* File read/write pointer (Byte offset origin from top of the file) */</span>
  21. DWORD clust; <span class="c">/* Current cluster of fptr (One cluster behind if fptr is on the cluster boundary. Invalid if fptr == 0.) */</span>
  22. DWORD sect; <span class="c">/* Current data sector (Can be invalid if fptr is on the cluster boundary.)*/</span>
  23. <span class="k">#if</span> !_FS_READONLY
  24. DWORD dir_sect; <span class="c">/* Sector number containing the directory entry */</span>
  25. BYTE* dir_ptr; <span class="c">/* Ponter to the directory entry in the window */</span>
  26. <span class="k">#endif</span>
  27. <span class="k">#if</span> _USE_FASTSEEK
  28. DWORD* cltbl; <span class="c">/* Pointer to the cluster link map table (Nulled on file open. Set by application.) */</span>
  29. <span class="k">#endif</span>
  30. <span class="k">#if</span> !_FS_TINY
  31. BYTE buf[_MAX_SS]; <span class="c">/* File private data transfer buffer (Always valid if fptr is not on the sector boundary but can be invalid if fptr is on the sector boundary.) */</span>
  32. <span class="k">#endif</span>
  33. } FIL;
  34. </pre>
  35. </div>
  36. <p class="foot"><a href="../00index_e.html">Return</a></p>
  37. </body>
  38. </html>