## f_puts

The f_puts function writes a string to the file.

    int f_puts (
      const TCHAR* str, /* [IN] String */
      FIL* fp           /* [IN] File object */
    );

#### Parameters

str
  Pointer to the null terminated string to be written. The null character will not be written.
fp
  Pointer to the open file object structure.

#### Return Value

When the function succeeded, number of characters written that is not minus value is returned. When the write operation is aborted due to disk full or any error, an `EOF (-1)` will be returned.

When the FatFs is configured to Unicode API (`_LFN_UNICODE == 1`), the UCS-2 string is written to the file in UTF-8 encoding. If not the case, the byte stream will be written directly.

#### Description

The `f_puts()` function is a wrapper function of `f_putc()` function.

#### QuickInfo

Available when `_FS_READONLY == 0` and `_USE_STRFUNC` is 1 or 2. When it is set to 2, `'\n'`s contained in the string are converted to `"\r\n"`.

#### See Also

`f_open, f_putc, f_printf, f_gets, f_close, FIL`

Return