Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

fputs - put string on stream

&pagelevel(4)&pagelevel

Syntax

#include <stdio.h>

int fputs(const char *s, FILE *stream); 

Description

fputs() writes the null-terminated string pointed to by s to the stream pointed to by stream.

The terminating null byte is not written.

The structure components st_ctime and st_mtime of the file are marked for changing
between successful execution of fputs() and the next successful completion of a call to
fflush() or fclose() for the same data stream or a call to exit() or abort() (see
sys/stat.h).

Return val.

Non-negative number



if successful.

 

BS2000


 

0

EOF

if successful. (End)

if an error occurs; errno is set to indicate the error.

Errors

Notes

See fputc().

puts() appends a newline character while fputs() does not.

On output to text files, control characters for white space (\n, \t, etc.) are converted to their
appropriate effect in accordance with the type of text file (see section “White-spacecharacters”).

BS2000

The following applies in the case of text files with SAM access mode and variable record
length for which a maximum record length is also specified: When the specification
split=no was entered for fopen(), records which are longer than the maximum record
length are truncated to the maximum record length when they are written. By default or with
the specification split=yes, these records are split into multiple records. If a record has
precisely the maximum record length, a record of the length zero is written after it. (End)

The program environment determines whether fputs() is executed for a BS2000 or
POSIX file.

See also

fopen(), fputc(), putc(), puts(), stdio.h, sys/stat.h.