Unixutils-1.54.1: A crude interface between Haskell and Unix-like operating systems
Safe HaskellNone
LanguageHaskell98

System.Unix.SpecialDevice

Description

Construct an ADT representing block and character devices (but mostly block devices) by interpreting the contents of the Linux sysfs filesystem.

Synopsis

Documentation

data SpecialDevice Source #

Instances

Instances details
Eq SpecialDevice Source # 
Instance details

Defined in System.Unix.SpecialDevice

Ord SpecialDevice Source # 
Instance details

Defined in System.Unix.SpecialDevice

Show SpecialDevice Source # 
Instance details

Defined in System.Unix.SpecialDevice

Methods

showsPrec :: Int -> SpecialDevice -> ShowS

show :: SpecialDevice -> String

showList :: [SpecialDevice] -> ShowS

sysMountPoint :: FilePath Source #

FIXME: We should really get this value from the mount table.

ofNode :: FilePath -> IO (Maybe SpecialDevice) Source #

Return the device represented by a device node, such as /dev/sda2. Returns Nothing if there is an exception trying to stat the node, or if the node turns out not to be a special device.

ofNodeStatus :: FileStatus -> Maybe SpecialDevice Source #

ofPath :: FilePath -> IO (Maybe SpecialDevice) Source #

ofDevNo :: (DeviceID -> SpecialDevice) -> Int -> SpecialDevice Source #

ofSysName :: String -> IO (Maybe SpecialDevice) Source #

ofSysPath :: (DeviceID -> SpecialDevice) -> FilePath -> IO (Maybe SpecialDevice) Source #

toDevno :: SpecialDevice -> DeviceID Source #

ofMajorMinor :: (DeviceID -> SpecialDevice) -> Int -> Int -> SpecialDevice Source #

node :: SpecialDevice -> IO (Maybe FilePath) Source #

nodes :: SpecialDevice -> IO [FilePath] Source #

sysName :: SpecialDevice -> IO (Maybe String) Source #

splitPart :: String -> (String, Int) Source #

sysDir :: SpecialDevice -> IO (Maybe FilePath) Source #