removeFile is:exact
removeFile file removes the directory entry for an
existing file
file, where
file is not itself a
directory. The implementation may specify additional constraints which
must be satisfied before a file can be removed (e.g. the file may not
be in use by other processes).
The operation may fail with:
- HardwareFault A physical I/O error has occurred.
[EIO]
- InvalidArgument The operand is not a valid file name.
[ENAMETOOLONG, ELOOP]
- isDoesNotExistError The file does not exist. [ENOENT,
ENOTDIR]
- isPermissionError The process has insufficient privileges
to perform the operation. [EROFS, EACCES, EPERM]
- UnsatisfiedConstraints Implementation-dependent
constraints are not satisfied. [EBUSY]
- InappropriateType The operand refers to an existing
directory. [EPERM, EINVAL]
removeFile file removes the directory entry for an
existing file
file, where
file is not itself a
directory. The implementation may specify additional constraints which
must be satisfied before a file can be removed (e.g. the file may not
be in use by other processes).
The operation may fail with:
- HardwareFault A physical I/O error has occurred.
[EIO]
- InvalidArgument The operand is not a valid file name.
[ENAMETOOLONG, ELOOP]
- isDoesNotExistError The file does not exist. [ENOENT,
ENOTDIR]
- isPermissionError The process has insufficient privileges
to perform the operation. [EROFS, EACCES, EPERM]
- UnsatisfiedConstraints Implementation-dependent
constraints are not satisfied. [EBUSY]
- InappropriateType The operand refers to an existing
directory. [EPERM, EINVAL]
removeFile file removes the directory entry for an
existing file
file, where
file is not itself a
directory. The implementation may specify additional constraints which
must be satisfied before a file can be removed (e.g. the file may not
be in use by other processes).
The operation may fail with:
- HardwareFault A physical I/O error has occurred.
[EIO]
- InvalidArgument The operand is not a valid file name.
[ENAMETOOLONG, ELOOP]
- isDoesNotExistError / NoSuchThing The file does
not exist. [ENOENT, ENOTDIR]
- isPermissionError / PermissionDenied The process
has insufficient privileges to perform the operation. [EROFS,
EACCES, EPERM]
- UnsatisfiedConstraints Implementation-dependent
constraints are not satisfied. [EBUSY]
- InappropriateType The operand refers to an existing
directory. [EPERM, EINVAL]
Remove a file. This will fail if the file does not exist.
This computation cannot remove directories. For that, use
removeDirectory or
removeTree.
This computation throws
IOError on failure. See “Classifying
I/O errors” in the
System.IO.Error documentation for
information on why the failure occured.
Remove a file. This function internally calls unlink. If the
file does not exist, an exception is thrown.