From cf9f3e13506afa3878a28e1e3bdc4b599d509f56 Mon Sep 17 00:00:00 2001 From: Phil Ruffwind Date: Sun, 7 Jul 2024 12:07:16 -0700 Subject: [PATCH] !should_fail --- System/Directory/Internal/Posix.hsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/System/Directory/Internal/Posix.hsc b/System/Directory/Internal/Posix.hsc index cd797b8e..57c5ac8a 100644 --- a/System/Directory/Internal/Posix.hsc +++ b/System/Directory/Internal/Posix.hsc @@ -127,7 +127,7 @@ exeExtensionInternal = exeExtension getDirectoryContentsInternal :: OsPath -> IO [OsPath] getDirectoryContentsInternal path = - withFileRef Nothing path getDirectoryRefContents + withFileRef Nothing (path os ".") getDirectoryRefContents getDirectoryRefContents :: FileRef -> IO [OsPath] getDirectoryRefContents fileRef = @@ -193,7 +193,7 @@ type FileRef = Posix.Fd withFileRef :: Maybe FileRef -> OsPath -> (FileRef -> IO r) -> IO r withFileRef dirRef (OsString name) = bracket - (Posix.openFdAt dirRef name Posix.ReadOnly defaultFlags) + (Posix.openFdAt dirRef name Posix.ReadOnly defaultFlags { Posix.nofollow = True, Posix.directory = True }) Posix.closeFd data Subref = NotSubdir -- ^ Not a directory (perhaps regular file or symlink).