GTK: improve file property dialog
Adds the following fields: * file type * permissions * link destination of symlink (if applicable)
This commit is contained in:
@@ -607,3 +607,21 @@ packPermissions dt = fromFreeVar (pStr . fileMode) dt
|
||||
| otherwise = "-"
|
||||
hasFM fm = ffm `PF.intersectFileModes` fm == fm
|
||||
|
||||
|
||||
packFileType :: File a -> String
|
||||
packFileType file = case file of
|
||||
Dir {} -> "Directory"
|
||||
RegFile {} -> "Regular File"
|
||||
SymLink {} -> "Symbolic Link"
|
||||
BlockDev {} -> "Block Device"
|
||||
CharDev {} -> "Char Device"
|
||||
NamedPipe {} -> "Named Pipe"
|
||||
Socket {} -> "Socket"
|
||||
_ -> "Unknown"
|
||||
|
||||
|
||||
packLinkDestination :: File a -> Maybe ByteString
|
||||
packLinkDestination file = case file of
|
||||
SymLink { rawdest = dest } -> Just dest
|
||||
_ -> Nothing
|
||||
|
||||
|
||||
Reference in New Issue
Block a user