• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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=utf-8">
5<meta http-equiv="Content-Style-Type" content="text/css">
6<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
7<title>FatFs - FIL</title>
8</head>
9
10<body>
11
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 <em>must not</em> modify any member in this structure except for <tt>cltbl</tt>, or the FAT volume will be collapsed. Note that a sector buffer is defined in this structure at non-tiny configuration (<tt><a href="config.html#fs_tiny">FF_FS_TINY</a> == 0</tt>), so that the <tt>FIL</tt> structures at that configuration should not be defined as auto variable.</p>
15
16<pre>
17<span class="k">typedef</span> <span class="k">struct</span> {
18    FFOBJID obj;          <span class="c">/* Object identifier */</span>
19    BYTE    flag;         <span class="c">/* File object status flags */</span>
20    BYTE    err;          <span class="c">/* Abort flag (error code) */</span>
21    FSIZE_t fptr;         <span class="c">/* File read/write pointer (Byte offset origin from top of the file) */</span>
22    DWORD   clust;        <span class="c">/* Current cluster of fptr (One cluster behind if fptr is on the cluster boundary. Invalid if fptr == 0.) */</span>
23    LBA_t   sect;         <span class="c">/* Current data sector (Can be invalid if fptr is on the cluster boundary.)*/</span>
24<span class="k">#if</span> !FF_FS_READONLY
25    LBA_t   dir_sect;     <span class="c">/* Sector number containing the directory entry */</span>
26    BYTE*   dir_ptr;      <span class="c">/* Ponter to the directory entry in the window */</span>
27<span class="k">#endif</span>
28<span class="k">#if</span> FF_USE_FASTSEEK
29    DWORD*  cltbl;        <span class="c">/* Pointer to the cluster link map table (Nulled on file open. Set by application.) */</span>
30<span class="k">#endif</span>
31<span class="k">#if</span> !FF_FS_TINY
32    BYTE    buf[FF_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>
33<span class="k">#endif</span>
34} FIL;
35</pre>
36
37</div>
38
39
40<p class="foot"><a href="../00index_e.html">Return</a></p>
41</body>
42</html>
43