From 91b2dc9e4bd240213ef64547869502b83955959f Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Thu, 31 Mar 2016 02:29:32 +0200 Subject: [PATCH] LIB: improve documentation in readWith --- src/HSFM/FileSystem/FileType.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/HSFM/FileSystem/FileType.hs b/src/HSFM/FileSystem/FileType.hs index 0ba42c2..4a70206 100644 --- a/src/HSFM/FileSystem/FileType.hs +++ b/src/HSFM/FileSystem/FileType.hs @@ -442,6 +442,10 @@ instance Ord (AnchoredFile FileInfo) where -- |Reads a file or directory Path into an `AnchoredFile`, filling the free -- 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 -- a variable -> Path Abs -- ^ Path to read @@ -450,7 +454,7 @@ readWith ff p = do let fn = P.basename p bd = P.dirname 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 fs <- PF.getSymbolicLinkStatus p' fv <- ff p