Name | Description | Notes | Source | Availability | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
FILENAME_ |
Maximum filename length | M | <stdio.h> |
C89 | C90 | C95 | C99 | C11 | |||
remove() |
Remove file | (·) | <stdio.h> |
C89 | C90 | C95 | C99 | C11 | |||
rename() |
Rename file | (·) | <stdio.h> |
C89 | C90 | C95 | C99 | C11 |
Filenames accepted by the functions fopen
, fopen_s
, freopen
, freopen_s
, rename
and remove
can be of upto
FILENAME_
characters, including a terminating null.
#include <stdio.h>
int remove(const char *name);
int rename(const char *from, const char *to);
remove
deletes the file
identified by the null-terminated string name
. It returns zero on success, and non-zero on
failure.
rename
renames the file
identified by the null-terminated string from
to the null-terminated string to
. It returns zero on success, and non-zero on
failure.
File contents can also be accessed through streams.