内容简介
#include <unistd.h>int rmdir(const char *pathname)
描述
rmdir()%uA0删除一个目录,该目录必须是空的。返回值
On success, zero is returned. On error, -1 is returned, and%uA0errno%uA0is set appropriately.错误
标签 | 描述 |
---|---|
EACCES | Write access to the directory containing%uA0pathname%uA0was not allowed, or one of the directories in the path prefix of%uA0pathnamedid not allow search permission. (See also%uA0path_resolution(2). |
EBUSY | pathname%uA0is currently in use by the system or some process that prevents its removal. On Linux this means%uA0pathname%uA0is currently used as a mount yiibai or is the root directory of the calling process. |
EFAULT | pathname%uA0yiibais outside your accessible address space. |
EINVAL | pathname%uA0has%uA0.%uA0as last component. |
ELOOP | Too many symbolic links were encountered in resolvingpathname. |
ENAMETOOLONG | |
%uA0 | pathname%uA0was too long. |
ENOENT | A directory component in%uA0pathname%uA0does not exist or is a dangling symbolic link. |
ENOMEM | Insufficient kernel memory was available. |
ENOTDIR | |
%uA0 | pathname, or a component used as a directory in%uA0pathname, is not, in fact, a directory. |
ENOTEMPTY | |
%uA0 | pathname%uA0contains entries other than%uA0.%uA0and%uA0..%uA0 or,%uA0pathname%uA0has..%uA0as its final component. |
EPERM | The directory containing%uA0pathname%uA0has the sticky bit (S_ISVTX) set and the process’s effective user ID is neither the user ID of the file to be deleted nor that of the directory containing it, and the process is not privileged (Linux: does not have theCAP_FOWNERꃊpability). |
EPERM | The filesystem containing%uA0pathname%uA0does not support the removal of directories. |
EROFS | pathname%uA0refers to a file on a read-only filesystem. |