Maintainer | ongy |
---|---|
Stability | experimental |
Portability | Linux |
Safe Haskell | None |
Language | Haskell2010 |
This module allows to read generic information about a block device and its file system.
It only works if the file system is mounted when the handle is created since it needs to *find* the mount point to get information about the file system
- data BlockHandle = BlockH FilePath
- getBlockHandle :: String -> IO (Maybe (BlockHandle, Dev))
- getBlockHandleTag :: String -> String -> IO (Maybe (BlockHandle, Dev))
- devToMount :: Dev -> IO (Maybe String)
Documentation
data BlockHandle Source #
The FsInfo handle exported by this module
getBlockHandle :: String -> IO (Maybe (BlockHandle, Dev)) Source #
Get a fs handle for normal
devices
This uses fsStat to get file system information.
fsStat takes the mount point of the file system, so we need to find the mount point.
In case of mapper devices, this is done by going through the chain of slaves.
getBlockHandleTag :: String -> String -> IO (Maybe (BlockHandle, Dev)) Source #
Same as getBlockHandle
but allow to pass the tag for libblkid
devToMount :: Dev -> IO (Maybe String) Source #
Get "the" mountpoint of a device.
Returns a mointpoint of a device. If there are multiple mountpoints, this will return the first one found. First one is mostly determined by order in procmounts and should be the one that was mounted first (time since boot).