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

📄 group__fat__file.html

📁 This project provides a general purpose library which implements read and write support for MMC, SD
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<div class="memproto">      <table class="memname">        <tr>          <td class="memname">uint8_t fat_create_file           </td>          <td>(</td>          <td class="paramtype">struct fat_dir_struct *&nbsp;</td>          <td class="paramname"> <em>parent</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">const char *&nbsp;</td>          <td class="paramname"> <em>file</em>, </td>        </tr>        <tr>          <td class="paramkey"></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><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td></td>        </tr>      </table></div><div class="memdoc"><p>Creates a file. <p>Creates a file and obtains the directory entry of the new file. If the file to create already exists, the directory entry of the existing file will be returned within the dir_entry parameter.<p><dl class="note" compact><dt><b>Note:</b></dt><dd>The file name is not checked for invalid characters.<p>The generation of the short 8.3 file name is quite simple. The first eight characters are used for the filename. The extension, if any, is made up of the first three characters following the last dot within the long filename. If the filename (without the extension) is longer than eight characters, the lower byte of the cluster number replaces the last two characters to avoid name clashes. In any other case, it is your responsibility to avoid name clashes.</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>parent</em>&nbsp;</td><td>The handle of the directory in which to create the file. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>file</em>&nbsp;</td><td>The name of the file to create. </td></tr>    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>dir_entry</em>&nbsp;</td><td>The directory entry to fill for the new file. </td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat.html#g46055219b942eb8d57ffae9dc6447e7c" title="Deletes a file or directory.">fat_delete_file</a> </dd></dl></div></div><p><a class="anchor" name="g46055219b942eb8d57ffae9dc6447e7c"></a><!-- doxytag: member="fat.c::fat_delete_file" ref="g46055219b942eb8d57ffae9dc6447e7c" args="(struct fat_fs_struct *fs, struct fat_dir_entry_struct *dir_entry)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">uint8_t fat_delete_file           </td>          <td>(</td>          <td class="paramtype">struct fat_fs_struct *&nbsp;</td>          <td class="paramname"> <em>fs</em>, </td>        </tr>        <tr>          <td class="paramkey"></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><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td></td>        </tr>      </table></div><div class="memdoc"><p>Deletes a file or directory. <p>If a directory is deleted without first deleting its subdirectories and files, disk space occupied by these files will get wasted as there is no chance to release it and mark it as free.<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>fs</em>&nbsp;</td><td>The filesystem on which to operate. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>dir_entry</em>&nbsp;</td><td>The directory entry of the file to delete. </td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat.html#g9d17d09125359dfb440fc57eede40b4f" title="Creates a file.">fat_create_file</a> </dd></dl></div></div><p><a class="anchor" name="g033743a7d8878712e0add6d57b750525"></a><!-- doxytag: member="fat.c::fat_get_dir_entry_of_path" ref="g033743a7d8878712e0add6d57b750525" args="(struct fat_fs_struct *fs, const char *path, struct fat_dir_entry_struct *dir_entry)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">uint8_t fat_get_dir_entry_of_path           </td>          <td>(</td>          <td class="paramtype">struct fat_fs_struct *&nbsp;</td>          <td class="paramname"> <em>fs</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">const char *&nbsp;</td>          <td class="paramname"> <em>path</em>, </td>        </tr>        <tr>          <td class="paramkey"></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><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td></td>        </tr>      </table></div><div class="memdoc"><p>Retrieves the directory entry of a path. <p>The given path may both describe a file or a directory.<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>fs</em>&nbsp;</td><td>The FAT filesystem on which to search. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>path</em>&nbsp;</td><td>The path of which to read the directory entry. </td></tr>    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>dir_entry</em>&nbsp;</td><td>The directory entry to fill. </td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on failure, 1 on success. </dd></dl><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat.html#gb4bc79452dbf5ac2a2f3e1fccafd9534" title="Reads the next directory entry contained within a parent directory.">fat_read_dir</a> </dd></dl></div></div><p><a class="anchor" name="g24763fd73cbeb580ae5d19e975bde0d8"></a><!-- doxytag: member="fat.c::fat_get_file_modification_date" ref="g24763fd73cbeb580ae5d19e975bde0d8" args="(const 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_get_file_modification_date           </td>          <td>(</td>          <td class="paramtype">const 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>Returns the modification date 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 of which to return the modification date. </td></tr>    <tr><td valign="top"><tt>[out]</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>[out]</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>[out]</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="g74f840c317556b7dae766e199d87a6ef"></a><!-- doxytag: member="fat.c::fat_get_file_modification_time" ref="g74f840c317556b7dae766e199d87a6ef" args="(const 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_get_file_modification_time           </td>          <td>(</td>          <td class="paramtype">const 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>Returns 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 of which to return the modification time. </td></tr>    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>hour</em>&nbsp;</td><td>The hour the file was last modified. </td></tr>    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>min</em>&nbsp;</td><td>The min the file was last modified. </td></tr>    <tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>sec</em>&nbsp;</td><td>The sec the file was last modified. </td></tr>  </table></dl></div></div><p><a class="anchor" name="g76a0b06949525b578db04a56d67fbfc4"></a><!-- doxytag: member="fat.c::fat_open_file" ref="g76a0b06949525b578db04a56d67fbfc4" args="(struct fat_fs_struct *fs, const struct fat_dir_entry_struct *dir_entry)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">struct fat_file_struct* fat_open_file           </td>          <td>(</td>          <td class="paramtype">struct fat_fs_struct *&nbsp;</td>          <td class="paramname"> <em>fs</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">const 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><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td><code> [read]</code></td>        </tr>      </table></div><div class="memdoc"><p>Opens a file on a FAT filesystem. <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>fs</em>&nbsp;</td><td>The filesystem on which the file to open lies. </td></tr>    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>dir_entry</em>&nbsp;</td><td>The directory entry of the file to open. </td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>The file handle, or 0 on failure. </dd></dl><dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__fat.html#g70b082abb4ebc8d4e9956886901b55fc" title="Closes a file.">fat_close_file</a> </dd></dl></div></div><p><a class="anchor" name="g48e17b173bede64cb08cef05b88fd0ca"></a><!-- doxytag: member="fat.c::fat_read_file" ref="g48e17b173bede64cb08cef05b88fd0ca" args="(struct fat_file_struct *fd, uint8_t *buffer, uintptr_t buffer_len)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">intptr_t fat_read_file           </td>          <td>(</td>          <td class="paramtype">struct fat_file_struct *&nbsp;</td>          <td class="paramname"> <em>fd</em>, </td>        </tr>        <tr>

⌨️ 快捷键说明

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