[commit: packages/directory] master: Refactor pathIsSymbolicLink to use Metadata interface (7794e23)
git at git.haskell.org
git at git.haskell.org
Mon Apr 17 21:36:01 UTC 2017
- Previous message: [commit: packages/containers] changelog-foldtree, cleaned_bugfix394, develop-0.6, develop-0.6-questionable, master, merge-doc-target, merge-fixes-5.9, merge-restrict-fix-5.8, revert-184-generic, revert-408-bugfix_394: Make sure the helper functions are inlined. (3e60f3a)
- Next message: [commit: packages/containers] changelog-foldtree, cleaned_bugfix394, develop-0.6, develop-0.6-questionable, master, merge-doc-target, merge-fixes-5.9, merge-restrict-fix-5.8, revert-184-generic, revert-408-bugfix_394: Move the closing parent to a separate line. (97599c0)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Repository : ssh://git@git.haskell.org/directory
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/7794e2388491059ba2d8cdce606eabbdef83b1fe/directory
>---------------------------------------------------------------
commit 7794e2388491059ba2d8cdce606eabbdef83b1fe
Author: Phil Ruffwind <rf at rufflewind.com>
Date: Tue Mar 7 05:38:20 2017 -0500
Refactor pathIsSymbolicLink to use Metadata interface
>---------------------------------------------------------------
7794e2388491059ba2d8cdce606eabbdef83b1fe
System/Directory.hs | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/System/Directory.hs b/System/Directory.hs
index ef92b28..7f314d5 100644
--- a/System/Directory.hs
+++ b/System/Directory.hs
@@ -1591,13 +1591,12 @@ pathIsSymbolicLink :: FilePath -> IO Bool
pathIsSymbolicLink path =
((`ioeAddLocation` "pathIsSymbolicLink") .
(`ioeSetFileName` path)) `modifyIOError` do
-#ifdef mingw32_HOST_OS
- isReparsePoint <$> Win32.getFileAttributes (toExtendedLengthPath path)
- where
- isReparsePoint attr = attr .&. win32_fILE_ATTRIBUTE_REPARSE_POINT /= 0
-#else
- Posix.isSymbolicLink <$> Posix.getSymbolicLinkStatus path
-#endif
+ m <- getSymbolicLinkMetadata path
+ return $
+ case fileTypeFromMetadata m of
+ DirectoryLink -> True
+ SymbolicLink -> True
+ _ -> False
{-# DEPRECATED isSymbolicLink "Use 'pathIsSymbolicLink' instead" #-}
isSymbolicLink :: FilePath -> IO Bool
- Previous message: [commit: packages/containers] changelog-foldtree, cleaned_bugfix394, develop-0.6, develop-0.6-questionable, master, merge-doc-target, merge-fixes-5.9, merge-restrict-fix-5.8, revert-184-generic, revert-408-bugfix_394: Make sure the helper functions are inlined. (3e60f3a)
- Next message: [commit: packages/containers] changelog-foldtree, cleaned_bugfix394, develop-0.6, develop-0.6-questionable, master, merge-doc-target, merge-fixes-5.9, merge-restrict-fix-5.8, revert-184-generic, revert-408-bugfix_394: Move the closing parent to a separate line. (97599c0)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the ghc-commits
mailing list