Skip to content

Commit 4cc0715

Browse files
handle symbolic links (or rather, lack of support thereof) properly in Windows
1 parent b094d1d commit 4cc0715

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/System/File/Tree.hs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable,
1+
{-# LANGUAGE CPP, GeneralizedNewtypeDeriving, DeriveDataTypeable,
22
FlexibleInstances, MultiParamTypeClasses, FunctionalDependencies,
33
TypeSynonymInstances, RankNTypes
44
#-}
@@ -179,9 +179,14 @@ isFile = doesFileExist
179179
isDir :: FilePath -> IO Bool
180180
isDir = doesDirectoryExist
181181

182-
-- |Checks if a path refers to a symbolic link
182+
-- |Checks if a path refers to a symbolic link.
183+
-- NOTE: always returns False on Windows
183184
isSymLink :: FilePath -> IO Bool
185+
#if CABAL_OS_WINDOWS
186+
isSymLink p = return False
187+
#else
184188
isSymLink p = isSymbolicLink <$> getSymbolicLinkStatus p
189+
#endif
185190

186191
-- |Checks if a path refers to a symbolically linked directory
187192
isSymDir :: FilePath -> IO Bool

0 commit comments

Comments
 (0)