FAT | RFS | XFS
puts()
PROTOTYPE
#include <stdio.h>
int puts(const char *string);
DESCRIPTION
puts() writes the null-terminated string indicated by string to the open regular file specified by stdout at its current position, or end if open in append mode. All characters up to the ending null are written as if by fputc(). A newline character is written last.
If successful, puts() updates the file’s status change and data modification timestamps, marks its metadata as dirty, advances its current position, and returns a non-negative number. Otherwise, it sets errno and the file’s error indicator, and returns EOF.
ERROR CODES
| EBADF | stdout is not the handle of a file open in write or append mode. |
| EFAULT | string equals NULL. |
| ENOSPC | The volume is full. |
EXAMPLE
/*-----------------------------------------------------------------*/
/* Write string to stdout. */
/*-----------------------------------------------------------------*/
if (puts("Hello World") == EOF)
{
perror("puts() failed");
return -1;
}