int remove(const char *path);
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).
Returns 0 on success. On failure, returns -1 and errno is set to one of the following:
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.
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.
path names a directory that is not empty; the directory contains entries other than those for dot (.) and dot-dot (..).
path is an invalid pointer.
The length of the path parameter exceeds PATH_MAX or a path component is longer than NAME_MAX.
path names a nonexistent file or directory or points to an empty string.
path points to a remote machine, and the link to that machine is no longer active.
2012/8.1/2012R2/10/2016/2019 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
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
PTC MKS Toolkit 10.3 Documentation Build 39.