Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (33 sloc) 1.46 KB
# C IO
## Removing Files
int remove ( const char *filename );
Deletes the given _filename_, returns non-zero int
when an error has occurred. See perror()
## Renaming Files
int rename ( const char *oldname, const char *newname );
Renames _oldname_ to _newname_, returns non-zero int
when an error has occurred. See perror()
## Temp Files
FILE *tmpfile ( void );
Creates a temporary binary file, open for writing.
The filename is guaranteed to be different from any other existing file.
The temporary file created is automatically deleted when the stream is closed (fclose)
or when the program terminates normally.
char *tmpnam ( char *str );
A string containing a filename different from any existing file is generated.
The filename will be stored in _str_ or a pointer will be returned when NULL
is given.
## Error Handling
void perror ( const char *str );
Interprets the value of the global variable errno into a string and
prints that string to stderr, optionally preceding it with a custom _str_,
which is followed by a colon (:) and a space.
## Macros
EOF End-of-File
FILENAME_MAX Max length for a filename
TMP_MAX Number of temporary files
NULL Null pointer
## Types
FILE Object containing information to control a stream
fpos_t Object containing information to specify a position within a file
size_t Unsigned integral type
Something went wrong with that request. Please try again.