LIB: improve documentation in readWith
This commit is contained in:
parent
a2e6ced69a
commit
91b2dc9e4b
@ -442,6 +442,10 @@ instance Ord (AnchoredFile FileInfo) where
|
|||||||
|
|
||||||
-- |Reads a file or directory Path into an `AnchoredFile`, filling the free
|
-- |Reads a file or directory Path into an `AnchoredFile`, filling the free
|
||||||
-- variables via the given function.
|
-- variables via the given function.
|
||||||
|
-- The dirname of the given path will be canonicalized using `realpath`, so the
|
||||||
|
-- anchor of `AnchoredFile` is always canonicalized.
|
||||||
|
--
|
||||||
|
-- Exceptions: when `canonicalizePath` fails, throws IOError
|
||||||
readWith :: (Path Abs -> IO a) -- ^ function that fills the free
|
readWith :: (Path Abs -> IO a) -- ^ function that fills the free
|
||||||
-- a variable
|
-- a variable
|
||||||
-> Path Abs -- ^ Path to read
|
-> Path Abs -- ^ Path to read
|
||||||
@ -450,7 +454,7 @@ readWith ff p = do
|
|||||||
let fn = P.basename p
|
let fn = P.basename p
|
||||||
bd = P.dirname p
|
bd = P.dirname p
|
||||||
p' = P.toFilePath p
|
p' = P.toFilePath p
|
||||||
bd' <- P.canonicalizePath bd -- TODO: this will cause a dialog to pop up on error
|
bd' <- P.canonicalizePath bd
|
||||||
handleDT bd' fn $ do
|
handleDT bd' fn $ do
|
||||||
fs <- PF.getSymbolicLinkStatus p'
|
fs <- PF.getSymbolicLinkStatus p'
|
||||||
fv <- ff p
|
fv <- ff p
|
||||||
|
Loading…
Reference in New Issue
Block a user