fatfs v0.08 May 15, 2010:

- Added a memory configuration option. (_USE_LFN)
- Added file lock feature. (_FS_SHARE)
- Added fast seek feature. (_USE_FASTSEEK)
- Changed some types on the API, XCHAR->TCHAR.
- Changed fname member in the FILINFO structure on Unicode cfg.
- String functions support UTF-8 encoding files on Unicode cfg.
This commit is contained in:
savelij13 committed 2025-09-11 09:40:03 +03:00
1 parent e6cd91ca0b
commit 46155916b1
92 files changed
+2469 -1589

No files matched your search

+15 -12
View File
@@ -4,6 +4,7 @@
<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/printf.html">
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
<title>FatFs - f_printf</title>
</head>
@@ -15,8 +16,8 @@
<p>The f_printf function writes formatted string to the file.</p>
<pre>
int f_printf (
FIL* <em>FileObject</em>, /* File object */
const char* <em>Foramt</em>, /* Format stirng */
FIL* <em>FileObject</em>, <span>/* File object */</span>
const TCHAR* <em>Foramt</em>, <span>/* Format stirng */</span>
...
);
</pre>
@@ -28,7 +29,7 @@ int f_printf (
<dt>FileObject</dt>
<dd>Pointer to the open file object structure.</dd>
<dt>Format</dt>
<dd>Pointer to the null-terminated format string.</dd>
<dd>Pointer to the null terminated format string.</dd>
<dt>...</dt>
<dd>Optional arguments.</dd>
@@ -38,7 +39,7 @@ int f_printf (
<div class="para">
<h4>Return Values</h4>
<p>When the function succeeded, number of characters written is returned. When the function failed due to disk full or any error, an <tt>EOF</tt> will be returned.</p>
<p>When the function succeeded, number of characters written is returned. When the function failed due to disk full or any error, an <tt>EOF (-1)</tt> will be returned.</p>
</div>
@@ -46,8 +47,8 @@ int f_printf (
<h4>Description</h4>
<p>The f_printf() is a wrapper function of <a href="putc.html">f_putc()</a> and <a href="puts.html">f_puts()</a>. The format control directive is a sub-set of standard library shown as follos:</p>
<ul>
<li>Type: <tt>c s d u X</tt></li>
<li>Size: <tt>l</tt></li>
<li>Type: <tt>c C s S d D u U x X b B</tt></li>
<li>Size: <tt>l L</tt></li>
<li>Flag: <tt>0</tt></li>
</ul>
</div>
@@ -56,18 +57,20 @@ int f_printf (
<div class="para">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_USE_STRFUNC</tt> is 1 or 2. When it is set to 2, <tt>'\n'</tt>s contained in the output are converted to <tt>"\r\n"</tt>.</p>
<p>When the FatFs is configured to Unicode API (<tt>_LFN_UNICODE == 1</tt>), the generated UCS-2 characters are written to the file in UTF-8 encoding. If not the case, the byte characters will be written directly.</p>
</div>
<div class="para">
<h4>Example</h4>
<pre>
f_printf(&amp;fil, "%6d", -200); /* " -200" */
f_printf(&amp;fil, "%02u", 5); /* "05" */
f_printf(&amp;fil, "%ld", 12345678L); /* "12345678" */
f_printf(&amp;fil, "%08lX", 1194684UL); /* "00123ABC" */
f_printf(&amp;fil, "%s", "String"); /* "String" */
f_printf(&amp;fil, "%c", 'a'); /* "a" */
f_printf(&amp;fil, "%6d", -200); <span>/* " -200" */</span>
f_printf(&amp;fil, "%02u", 5); <span>/* "05" */</span>
f_printf(&amp;fil, "%ld", 12345678L); <span>/* "12345678" */</span>
f_printf(&amp;fil, "%08lX", 1194684UL); <span>/* "00123ABC" */</span>
f_printf(&amp;fil, "%08b", 0x55); <span>/* "01010101" */</span>
f_printf(&amp;fil, "%s", "String"); <span>/* "String" */</span>
f_printf(&amp;fil, "%c", 'a'); <span>/* "a" */</span>
</pre>
</div>