X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Ffs%2Ffatfs%2Fdoc%2Fen%2Fprintf.html;fp=bertos%2Ffs%2Ffatfs%2Fdoc%2Fen%2Fprintf.html;h=482d07da13c73442b11f17e094ebcac91aa3f196;hb=ff4ad791a0fdf06f0295ecf9d76319a9b90f921d;hp=0000000000000000000000000000000000000000;hpb=90799b8b250623464b9fafb5c49bebd02d23bb61;p=bertos.git diff --git a/bertos/fs/fatfs/doc/en/printf.html b/bertos/fs/fatfs/doc/en/printf.html new file mode 100644 index 00000000..482d07da --- /dev/null +++ b/bertos/fs/fatfs/doc/en/printf.html @@ -0,0 +1,72 @@ + + + + + + + +FatFs - f_printf + + + + +
+

f_printf

+

The f_printf function writes formatted string to the file.

+
+int f_printf (
+  FIL* FileObject,     /* File object */
+  const char* Foramt,  /* Format stirng */
+  ...
+);
+
+
+ +
+

Parameters

+
+
FileObject
+
Pointer to the open file object structure.
+
Format
+
Pointer to the null-terminated format string.
+
...
+
Optional arguments.
+ +
+
+ + +
+

Return Values

+

When the function succeeded, number of characters written is returned. When the function failed due to disk full or any error, an EOF will be returned.

+
+ + +
+

Description

+

The f_printf() is a wrapper function of f_putc() and f_puts(). The format control directive is a sub-set of standard library. It supports c s d u X for the data type, l for the precision and 0 for the flags.

+

This function is available when read-write configuration and _USE_STRFUNC is 1 or 2.

+
+ + +
+

Example

+
+    f_printf(&fil, "%6d", -200);         // "  -200"
+    f_printf(&fil, "%02u", 5);           // "05"
+    f_printf(&fil, "%ld", 12345678L);    // "12345678"
+    f_printf(&fil, "%08lX", 1194684UL);  // "00123ABC"
+    f_printf(&fil, "%s", "String");      // "String"
+    f_printf(&fil, "%c", 'a');           // "a"
+
+
+ + +
+

References

+

f_open, f_putc, f_puts, f_gets, f_close, FIL

+
+ +

Return

+ +