check hook executability
This commit is contained in:
parent
caf97fcffd
commit
95a1f6b2ac
2 changed files with 15 additions and 2 deletions
|
@ -34,3 +34,10 @@ allowWrite f = do
|
|||
{- Checks if a file mode indicates it's a symlink. -}
|
||||
isSymLink :: FileMode -> Bool
|
||||
isSymLink mode = symbolicLinkMode `intersectFileModes` mode == symbolicLinkMode
|
||||
|
||||
{- Checks if a file has any executable bits set. -}
|
||||
isExecutable :: FileMode -> Bool
|
||||
isExecutable mode = ebits `intersectFileModes` mode /= 0
|
||||
where
|
||||
ebits = ownerExecuteMode `unionFileModes`
|
||||
groupExecuteMode `unionFileModes` otherExecuteMode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue