1e6865dcdSopenharmony_ci<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 2e6865dcdSopenharmony_ci<html lang="en"> 3e6865dcdSopenharmony_ci<head> 4e6865dcdSopenharmony_ci<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 5e6865dcdSopenharmony_ci<meta http-equiv="Content-Style-Type" content="text/css"> 6e6865dcdSopenharmony_ci<link rel="up" title="FatFs" href="../00index_e.html"> 7e6865dcdSopenharmony_ci<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/sfile.html"> 8e6865dcdSopenharmony_ci<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default"> 9e6865dcdSopenharmony_ci<title>FatFs - FIL</title> 10e6865dcdSopenharmony_ci</head> 11e6865dcdSopenharmony_ci 12e6865dcdSopenharmony_ci<body> 13e6865dcdSopenharmony_ci 14e6865dcdSopenharmony_ci<div class="para"> 15e6865dcdSopenharmony_ci<h2>FIL</h2> 16e6865dcdSopenharmony_ci<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> 17e6865dcdSopenharmony_ci 18e6865dcdSopenharmony_ci<pre> 19e6865dcdSopenharmony_ci<span class="k">typedef</span> <span class="k">struct</span> { 20e6865dcdSopenharmony_ci FFOBJID obj; <span class="c">/* Object identifier */</span> 21e6865dcdSopenharmony_ci BYTE flag; <span class="c">/* File object status flags */</span> 22e6865dcdSopenharmony_ci BYTE err; <span class="c">/* Abort flag (error code) */</span> 23e6865dcdSopenharmony_ci FSIZE_t fptr; <span class="c">/* File read/write pointer (Byte offset origin from top of the file) */</span> 24e6865dcdSopenharmony_ci DWORD clust; <span class="c">/* Current cluster of fptr (One cluster behind if fptr is on the cluster boundary. Invalid if fptr == 0.) */</span> 25e6865dcdSopenharmony_ci LBA_t sect; <span class="c">/* Current data sector (Can be invalid if fptr is on the cluster boundary.)*/</span> 26e6865dcdSopenharmony_ci<span class="k">#if</span> !FF_FS_READONLY 27e6865dcdSopenharmony_ci LBA_t dir_sect; <span class="c">/* Sector number containing the directory entry */</span> 28e6865dcdSopenharmony_ci BYTE* dir_ptr; <span class="c">/* Ponter to the directory entry in the window */</span> 29e6865dcdSopenharmony_ci<span class="k">#endif</span> 30e6865dcdSopenharmony_ci<span class="k">#if</span> FF_USE_FASTSEEK 31e6865dcdSopenharmony_ci DWORD* cltbl; <span class="c">/* Pointer to the cluster link map table (Nulled on file open. Set by application.) */</span> 32e6865dcdSopenharmony_ci<span class="k">#endif</span> 33e6865dcdSopenharmony_ci<span class="k">#if</span> !FF_FS_TINY 34e6865dcdSopenharmony_ci 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> 35e6865dcdSopenharmony_ci<span class="k">#endif</span> 36e6865dcdSopenharmony_ci} FIL; 37e6865dcdSopenharmony_ci</pre> 38e6865dcdSopenharmony_ci 39e6865dcdSopenharmony_ci</div> 40e6865dcdSopenharmony_ci 41e6865dcdSopenharmony_ci<p class="foot"><a href="../00index_e.html">Return</a></p> 42e6865dcdSopenharmony_ci</body> 43e6865dcdSopenharmony_ci</html> 44