LIB: improve documentation
This commit is contained in:
parent
6ec455b515
commit
8b0e59faa7
@ -406,17 +406,35 @@ deleteFile p = P.withAbsPath p removeLink
|
|||||||
|
|
||||||
|
|
||||||
-- |Deletes the given directory, which must be empty, never symlinks.
|
-- |Deletes the given directory, which must be empty, never symlinks.
|
||||||
|
--
|
||||||
|
-- Throws:
|
||||||
|
--
|
||||||
|
-- - `InappropriateType` for wrong file type (symlink to directory)
|
||||||
|
-- - `InappropriateType` for wrong file type (regular file)
|
||||||
|
-- - `NoSuchThing` if directory does not exist
|
||||||
|
-- - `UnsatisfiedConstraints` if directory is not empty
|
||||||
|
-- - `PermissionDenied` if we can't open or write to parent directory
|
||||||
|
--
|
||||||
|
-- Notes: calls `rmdir`
|
||||||
deleteDir :: Path Abs -> IO ()
|
deleteDir :: Path Abs -> IO ()
|
||||||
deleteDir p = P.withAbsPath p removeDirectory
|
deleteDir p = P.withAbsPath p removeDirectory
|
||||||
|
|
||||||
|
|
||||||
-- |Deletes the given directory recursively. Does not follow symbolic
|
-- |Deletes the given directory recursively. Does not follow symbolic
|
||||||
-- links.
|
-- links. Tries `deleteDir` first before attemtping a recursive
|
||||||
|
-- deletion.
|
||||||
--
|
--
|
||||||
-- Safety/reliability concerns:
|
-- Safety/reliability concerns:
|
||||||
--
|
--
|
||||||
-- * not atomic
|
-- * not atomic
|
||||||
-- * examines filetypes explicitly
|
-- * examines filetypes explicitly
|
||||||
|
--
|
||||||
|
-- Throws:
|
||||||
|
--
|
||||||
|
-- - `InappropriateType` for wrong file type (symlink to directory)
|
||||||
|
-- - `InappropriateType` for wrong file type (regular file)
|
||||||
|
-- - `NoSuchThing` if directory does not exist
|
||||||
|
-- - `PermissionDenied` if we can't open or write to parent directory
|
||||||
deleteDirRecursive :: Path Abs -> IO ()
|
deleteDirRecursive :: Path Abs -> IO ()
|
||||||
deleteDirRecursive p =
|
deleteDirRecursive p =
|
||||||
catchErrno [eNOTEMPTY, eEXIST]
|
catchErrno [eNOTEMPTY, eEXIST]
|
||||||
|
Loading…
Reference in New Issue
Block a user