Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

File processing

&pagelevel(3)&pagelevel

eThe term "elementary", as used below, refers to all I/O functions that work on the basis of file descriptors, as opposed to the standard I/O functions, which work on the basis of file pointers. In addition, functions that can also be used on files with record-oriented input/output (record I/O) are indicated as such.

File access (open, close, position)

Name

Brief description

close

Close file and flush buffer (elementary, also record I/O)

creat

Create file or overwrite existing file (elementary, also record I/O)

creat64

64-bit variant of creat for processing large files (> 2 GB, also record I/O)

fclose

Close file and flush buffer (also record I/O)

fdelrec

Delete record in indexed-sequential file (record I/O only)

fdopen

Assign a file pointer to a file descriptor

fflush

Flush file buffer

fgetpos

Return current position of the read/write pointer (also record I/O)

fgetpos64

64-bit variant of fgetpos for processing large files (> 2 GB)

flocate

Explicitly position indexed-sequential file (record I/O only)

fopen

Open file (also record I/O)

fopen64

64-bit variant of fopen for processing large files (> 2 GB, also record I/O)

freopen

Reassign file pointer (also record I/O)

freopen64

64-bit variant of freopen for processing large files (> 2 GB, also record I/O)

fseek

Position read/write pointer (also record I/O)

fseek64

64-bit variant of fseek for processing large files (> 2 GB, also record I/O)

fsetpos

Position read/write pointer (also record I/O)

fsetpos64

64-bit variant of fsetpos for processing large files (> 2 GB, also record I/O)

ftell

Determine current position of the read/write pointer

ftell64

64-bit variant of ftell for processing large files (> 2 GB)

lseek

Position read/write pointer (elementary, also record I/O)

lseek64

64-bit variant of lseek for processing large files (> 2 GB, also record I/O)

fwide

Query/define orientation of a file

open

Open file (elementary, also record I/O)

open64

64-bit variant of open for processing large files (> 2 GB, also record I/O)

rewind

Position read/write pointer to beginning of file (also record I/O)

setbuf

Set up input/output buffer

setvbuf

Set up input/output buffer

tell

Query current position of the read/write pointer (elementary)

File management

Name

Brief description

bs2fstat

Access file name from catalog

mktemp

Generate unique temporary file name

remove

Delete file (also record I/O)

rename

Rename file (also record I/O)

tmpfile

Open temporary binary file

tmpfile64

64-bit variant of tmpfile for processing large files (>2 GB)

tmpnam

Generate temporary file name

unlink

Erase file (also record I/O)

File and error information

Name

Brief description

clearerr

Delete end-of-file and error flag (also record I/O)

feof

Test for end of file (also record I/O)

ferror

Test for file error (also record I/O)

Input/output

Name

Brief description

fgetc

Read a character from a file

fgets

Read a string from a file

fgetwc

Read a wide character from input file

fgetws

Read a wide character string from a file

fprintf

Formatted output to a file

fputc

Write a character to a file

fputs

Write a string to a file

fputwc

Write a wide character to a file

fputws

Write a wide character string to a file

fread

Read blockwise from a file (also record I/O)

fscanf

Formatted input from a file

fwprintf

Write a formatted character to an output file (wide character format)

fwrite

Write blockwise to a file (also record I/O)

fwscanf

Formatted input from a file (wide character format)

getc

Read a character from a file

getchar

Read a character from standard input

gets

Read a string from standard input

getw

Read wordwise from a file

getwc

Read a wide character from a file

getwchar

Read a wide character from standard input

printf

Formatted output to standard output

putc

Write a character to a file

putchar

Output a character to standard output

puts

Output a string to standard output

putw

Write wordwise to a file

putwc

Write a wide character to a file

putwchar

Write wide characters to standard output

read

Read from a file (elementary, also record I/O)

scanf

Formatted input from standard input

snprintf

Formatted output to a string

sprintf

Formatted output to a string

sscanf

Formatted input from a string

swprintf

Formatted output to a wide character string

swscanf

Formatted input from a wide character string

ungetc

Put a character back in the buffer

ungetwc

Put a wide character back in the buffer

vfprintf

Formatted output to a file

vfwprintf

Write a formatted character to a file (wide character format)

vfwscanf

Formatted input from a file (wide character format)

vprintf

Formatted output to standard output

vsnprintf

Formatted output to character string

vsprintf

Formatted output to character string

vswprintf

Write a formatted character to a wide character string

vswscanf

Formatted input from a wide character string

vwprintf

Formatted output to standard output (wide character format)

vwscanf

Formatted input from standard input (wide character format)

wprintf

Formatted output to standard output (wide character format)

write

Write to a file (elementary, also record I/O)

wscanf

Formatted input from standard input (wide character format)