Syntax | #include <unistd.h> int rmdir(const char *path); | |
Description |
If path is a symbolic link, it is not followed. If path is the root directory, then path is set to If the directory link count becomes 0 and no process has the directory open, the space occupied by the directory will be freed and the directory will no longer be accessible. If one or more processes have the directory open when the last link is removed, the dot and dot-dot entries, if present, are removed before Upon successful completion, | |
Return val. | 0 | if successful. |
-1 | if an error occurs. | |
Errors |
|
|
|
| Search permission is denied on a component of the path, or write permission is denied on the parent directory of the directory to be removed. |
|
| The directory to be removed is currently in use by the system or another process. |
|
| |
path names a directory that is not an empty directory. | ||
| Extension | |
|
| path points outside the allocated address space of the process. |
|
| The directory to be removed is the current directory. |
|
| An I/O error occurred when accessing the file system. |
|
| Too many symbolic links were encountered in resolving path. (End) |
| ||
The length of the path argument exceeds | ||
| path names a non-existent directory or points to an empty string . | |
| A component of the path is not a directory. (End) | |
| The directory entry to be removed resides on a read-only file system. | |
Notes |
| |
See also |
|