aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/fatfs-0.10b/doc/en/sfile.html
blob: 930573e85d4926565fe8bac05c55ee3bb2e5df84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="up" title="FatFs" href="../00index_e.html">
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sfile.html">
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
<title>FatFs - FIL</title>
</head>

<body>

<div class="para">
<h2>FIL</h2>
<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>

<pre>
<span class="k">typedef</span> <span class="k">struct</span> {
    FATFS*  fs;           <span class="c">/* Pointer to the owner file system object */</span>
    WORD    id;           <span class="c">/* Owner file system mount ID */</span>
    BYTE    flag;         <span class="c">/* File object status flags */</span>
    BYTE    err;          <span class="c">/* Abort flag (error code) */</span>
    DWORD   fptr;         <span class="c">/* File read/write pointer (Byte offset origin from top of the file) */</span>
    DWORD   fsize;        <span class="c">/* File size in unit of byte */</span>
    DWORD   sclust;       <span class="c">/* File start cluster */</span>
    DWORD   clust;        <span class="c">/* Current cluster */</span>
    DWORD   dsect;        <span class="c">/* Current data sector */</span>
<span class="k">#if</span> !_FS_READONLY
    DWORD   dir_sect;     <span class="c">/* Sector containing the directory entry */</span>
    BYTE*   dir_ptr;      <span class="c">/* Ponter to the directory entry in the window */</span>
<span class="k">#endif</span>
<span class="k">#if</span> _USE_FASTSEEK
    DWORD*  cltbl;        <span class="c">/* Pointer to the cluster link map table (Nulled on file open) */</span>
<span class="k">#endif</span>
<span class="k">#if</span> _FS_LOCK
    UINT    lockid;       <span class="c">/* Fle lock ID */</span>
<span class="k">#endif</span>
<span class="k">#if</span> !_FS_TINY
    BYTE    buf[_MAX_SS]; <span class="c">/* File private data transfer buffer */</span>
<span class="k">#endif</span>
} FIL;
</pre>

</div>

<p class="foot"><a href="../00index_e.html">Return</a></p>
</body>
</html>