You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling test multiple times will add the overhead of making the stat system call multiple times. We can write the predicate in a way so that it does not have to use test multiple times. It may possibly require the predicate to be of type a -> m Bool rather the a -> Bool. I will have to look into it.
isAccessible in module Streamly.Coreutils.FileTest
isAccessible :: Tuple3 FileMode FileMode FileMode -> FilePath -> IO FileTest
isAccessible (Tuple3 onr grp oth) path = do
ownerIDMatch <- ownerMatchesEUID
groupIDMatch <- groupMatchesEGID
let ownerPerm = FileTest $ hasMode onr
groupPerm = FileTest $ hasMode grp
otherPerm = FileTest $ hasMode oth
ownerHasPermission <- test path ownerPerm
groupHasPermission <- test path groupPerm
isOwner <- test path ownerIDMatch
The text was updated successfully, but these errors were encountered: