SYNOPSIS
#include <stdio.h>
int remove(const char *path);
DESCRIPTION
If path does not name a directory, remove(path) is equivalent to unlink(path).
If path names a directory, remove(path) is equivalent to rmdir(path).
PARAMETERS
RETURN VALUES
Returns 0 on success. On failure, returns -1 and errno is set to one of the following:
- EACCES
-
Search permission is denied on a component of the path prefix.
Write permission is denied on the directory that contains the path to be removed.
- EBUSY
-
The path to be removed is currently in use by the system or another process or the directory to be removed is the current directory of some process.
- EEXIST
-
path names a directory that is not empty; the directory contains entries other than those for dot (.) and dot-dot (..).
- EFAULT
-
path is an invalid pointer.
- ENAMETOOLONG
-
The length of the path parameter exceeds PATH_MAX or a path component is longer than NAME_MAX.
- ENOENT
-
path names a nonexistent file or directory or points to an empty string.
- ENOLINK
-
path points to a remote machine, and the link to that machine is no longer active.
CONFORMANCE
ANSI/ISO 9899-1990.
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
8.1/2012R2/10/2016/2019/11/2022 does not let you
delete a directory if a user has a lock on it. Any user that is
in that directory has a lock on it. All locks to a directory must
be resolved before
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
PTC MKS Toolkit 10.4 Documentation Build 39.