Information

Author(s) Olivier Martin
Deadline No deadline
Submission limit No limitation
Category tags S5, Files, Level 2

Tags

Sign in

[S5] File exists

Estimated time: 10 minutes

Using open(2), determine if a file exists. Read the documentation to know how to do that, especially the parts about the flags you can use.

Note : you can only use open().


File exist
/*
 * @pre filename != NULL
 * @post return 0 if the file {filename} exist. -1 Otherwise.
 */
 int file_exists(char *filename)