File system


int unlink(const char* pathname)

Removes a file from the file system.

  • pathname: The pathname to the file (Unix-style, with forward slash as the directory separator).

Returns 0 on success. On error, returns -1 and sets errno. Some possible errno values include:

  • EEXIST or ENOTEMPTY: Directory is not empty.