⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 group__fat__file.html

📁 This project provides a general purpose library which implements read and write support for MMC, SD
💻 HTML
📖 第 1 页 / 共 3 页
字号:
          <td class="paramkey"></td>          <td></td>          <td class="paramtype">uint8_t *&nbsp;</td>          <td class="paramname"> <em>buffer</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">uintptr_t&nbsp;</td>          <td class="paramname"> <em>buffer_len</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td></td>        </tr>      </table></div><div class="memdoc"><p>Reads data from a file. <p>The data requested is read from the current file location.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>fd</em>&nbsp;</td><td>The file handle of the file from which to read. </td></tr>    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>buffer</em>&nbsp;</td><td>The buffer into which to write. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>buffer_len</em>&nbsp;</td><td>The amount of data to read. </td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>The number of bytes read, 0 on end of file, or -1 on failure. </dd></dl><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat.html#g6782ff80eb6fba9b6ed1a66f33dae60a" title="Writes data to a file.">fat_write_file</a> </dd></dl></div></div><p><a class="anchor" name="gce4858e7a145684f6c8cd14debe14255"></a><!-- doxytag: member="fat.c::fat_resize_file" ref="gce4858e7a145684f6c8cd14debe14255" args="(struct fat_file_struct *fd, uint32_t size)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">uint8_t fat_resize_file           </td>          <td>(</td>          <td class="paramtype">struct fat_file_struct *&nbsp;</td>          <td class="paramname"> <em>fd</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">uint32_t&nbsp;</td>          <td class="paramname"> <em>size</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td></td>        </tr>      </table></div><div class="memdoc"><p>Resizes a file to have a specific size. <p>Enlarges or shrinks the file pointed to by the file descriptor to have exactly the specified size.<p>If the file is truncated, all bytes having an equal or larger offset than the given size are lost. If the file is expanded, the additional bytes are allocated.<p><dl class="note" compact><dt><b>Note:</b></dt><dd>Please be aware that this function just allocates or deallocates disk space, it does not explicitely clear it. To avoid data leakage, this must be done manually.</dd></dl><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>fd</em>&nbsp;</td><td>The file decriptor of the file which to resize. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>size</em>&nbsp;</td><td>The new size of the file. </td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl></div></div><p><a class="anchor" name="gd4c305cf004bae9bea48730ed20c87ec"></a><!-- doxytag: member="fat.c::fat_seek_file" ref="gd4c305cf004bae9bea48730ed20c87ec" args="(struct fat_file_struct *fd, int32_t *offset, uint8_t whence)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">uint8_t fat_seek_file           </td>          <td>(</td>          <td class="paramtype">struct fat_file_struct *&nbsp;</td>          <td class="paramname"> <em>fd</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int32_t *&nbsp;</td>          <td class="paramname"> <em>offset</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">uint8_t&nbsp;</td>          <td class="paramname"> <em>whence</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td></td>        </tr>      </table></div><div class="memdoc"><p>Repositions the read/write file offset. <p>Changes the file offset where the next call to <a class="el" href="group__fat__file.html#g48e17b173bede64cb08cef05b88fd0ca" title="Reads data from a file.">fat_read_file()</a> or <a class="el" href="group__fat__file.html#g6782ff80eb6fba9b6ed1a66f33dae60a" title="Writes data to a file.">fat_write_file()</a> starts reading/writing.<p>If the new offset is beyond the end of the file, <a class="el" href="group__fat__file.html#gce4858e7a145684f6c8cd14debe14255" title="Resizes a file to have a specific size.">fat_resize_file()</a> is implicitly called, i.e. the file is expanded.<p>The new offset can be given in different ways determined by the <code>whence</code> parameter:<ul><li><b>FAT_SEEK_SET:</b> <code>*offset</code> is relative to the beginning of the file.</li><li><b>FAT_SEEK_CUR:</b> <code>*offset</code> is relative to the current file position.</li><li><b>FAT_SEEK_END:</b> <code>*offset</code> is relative to the end of the file.</li></ul><p>The resulting absolute offset is written to the location the <code>offset</code> parameter points to.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>fd</em>&nbsp;</td><td>The file decriptor of the file on which to seek. </td></tr>    <tr><td valign="top"><tt>[in,out]</tt>&nbsp;</td><td valign="top"><em>offset</em>&nbsp;</td><td>A pointer to the new offset, as affected by the <code>whence</code> parameter. The function writes the new absolute offset to this location before it returns. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>whence</em>&nbsp;</td><td>Affects the way <code>offset</code> is interpreted, see above. </td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl></div></div><p><a class="anchor" name="g02c969e994a556534c92906db5bb04fd"></a><!-- doxytag: member="fat.c::fat_set_file_modification_date" ref="g02c969e994a556534c92906db5bb04fd" args="(struct fat_dir_entry_struct *dir_entry, uint16_t year, uint8_t month, uint8_t day)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">void fat_set_file_modification_date           </td>          <td>(</td>          <td class="paramtype">struct <a class="el" href="structfat__dir__entry__struct.html">fat_dir_entry_struct</a> *&nbsp;</td>          <td class="paramname"> <em>dir_entry</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">uint16_t&nbsp;</td>          <td class="paramname"> <em>year</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">uint8_t&nbsp;</td>          <td class="paramname"> <em>month</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">uint8_t&nbsp;</td>          <td class="paramname"> <em>day</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td></td>        </tr>      </table></div><div class="memdoc"><p>Sets the modification time of a date. <p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>dir_entry</em>&nbsp;</td><td>The directory entry for which to set the modification date. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>year</em>&nbsp;</td><td>The year the file was last modified. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>month</em>&nbsp;</td><td>The month the file was last modified. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>day</em>&nbsp;</td><td>The day the file was last modified. </td></tr>  </table></dl></div></div><p><a class="anchor" name="gb514f14ce35a38bff3f16270dfdc033b"></a><!-- doxytag: member="fat.c::fat_set_file_modification_time" ref="gb514f14ce35a38bff3f16270dfdc033b" args="(struct fat_dir_entry_struct *dir_entry, uint8_t hour, uint8_t min, uint8_t sec)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">void fat_set_file_modification_time           </td>          <td>(</td>          <td class="paramtype">struct <a class="el" href="structfat__dir__entry__struct.html">fat_dir_entry_struct</a> *&nbsp;</td>          <td class="paramname"> <em>dir_entry</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">uint8_t&nbsp;</td>          <td class="paramname"> <em>hour</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">uint8_t&nbsp;</td>          <td class="paramname"> <em>min</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">uint8_t&nbsp;</td>          <td class="paramname"> <em>sec</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td></td>        </tr>      </table></div><div class="memdoc"><p>Sets the modification time of a file. <p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>dir_entry</em>&nbsp;</td><td>The directory entry for which to set the modification time. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>hour</em>&nbsp;</td><td>The year the file was last modified. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>min</em>&nbsp;</td><td>The month the file was last modified. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>sec</em>&nbsp;</td><td>The day the file was last modified. </td></tr>  </table></dl></div></div><p><a class="anchor" name="g6782ff80eb6fba9b6ed1a66f33dae60a"></a><!-- doxytag: member="fat.c::fat_write_file" ref="g6782ff80eb6fba9b6ed1a66f33dae60a" args="(struct fat_file_struct *fd, const uint8_t *buffer, uintptr_t buffer_len)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">intptr_t fat_write_file           </td>          <td>(</td>          <td class="paramtype">struct fat_file_struct *&nbsp;</td>          <td class="paramname"> <em>fd</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">const uint8_t *&nbsp;</td>          <td class="paramname"> <em>buffer</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">uintptr_t&nbsp;</td>          <td class="paramname"> <em>buffer_len</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td></td>        </tr>      </table></div><div class="memdoc"><p>Writes data to a file. <p>The data is written to the current file location.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>fd</em>&nbsp;</td><td>The file handle of the file to which to write. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>buffer</em>&nbsp;</td><td>The buffer from which to read the data to be written. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>buffer_len</em>&nbsp;</td><td>The amount of data to write. </td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>The number of bytes written, 0 on disk full, or -1 on failure. </dd></dl><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat.html#g48e17b173bede64cb08cef05b88fd0ca" title="Reads data from a file.">fat_read_file</a> </dd></dl></div></div><p></div><hr size="1"><address style="text-align: right;"><small>Generated on Mon Mar 30 18:27:54 2009 for sd-reader by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -