LIB: fix file type indicators
It seems that PF.regularFileMode matches across symlinks and sockets too, so we just examine the constructors instead. Fixes #25
This commit is contained in:
parent
048bf8a328
commit
2bc406f65e
@ -784,14 +784,14 @@ packPermissions dt = fromFreeVar (pStr . fileMode) dt
|
|||||||
where
|
where
|
||||||
pStr ffm = typeModeStr ++ ownerModeStr ++ groupModeStr ++ otherModeStr
|
pStr ffm = typeModeStr ++ ownerModeStr ++ groupModeStr ++ otherModeStr
|
||||||
where
|
where
|
||||||
typeModeStr
|
typeModeStr = case dt of
|
||||||
| hasFM PF.regularFileMode = "-"
|
Dir {} -> "d"
|
||||||
| hasFM PF.directoryMode = "d"
|
RegFile {} -> "-"
|
||||||
| hasFM PF.symbolicLinkMode = "l"
|
SymLink {} -> "l"
|
||||||
| hasFM PF.socketMode = "s"
|
BlockDev {} -> "b"
|
||||||
| hasFM PF.blockSpecialMode = "b"
|
CharDev {} -> "c"
|
||||||
| hasFM PF.characterSpecialMode = "c"
|
NamedPipe {} -> "p"
|
||||||
| hasFM PF.namedPipeMode = "p"
|
Socket {} -> "s"
|
||||||
ownerModeStr = hasFmStr PF.ownerReadMode "r"
|
ownerModeStr = hasFmStr PF.ownerReadMode "r"
|
||||||
++ hasFmStr PF.ownerWriteMode "w"
|
++ hasFmStr PF.ownerWriteMode "w"
|
||||||
++ hasFmStr PF.ownerExecuteMode "x"
|
++ hasFmStr PF.ownerExecuteMode "x"
|
||||||
|
Loading…
Reference in New Issue
Block a user