-- | Find device path by number (major, minor)
openDeviceDir :: DeviceManager -> Device -> FlowT OpenErrors Sys Handle
openDeviceDir dm dev = open (Just (dmDevFS dm)) path (BitSet.fromList [HandleDirectory]) BitSet.empty
   where
      path = "./dev/" ++ typ' ++ "/" ++ ids
      typ' = case deviceType dev of
         CharDevice  -> "char"
         BlockDevice -> "block"
      ids  = show (deviceMajor (deviceID dev)) ++ ":" ++ show (deviceMinor (deviceID dev))

-- | List devices
openDeviceDir :: DeviceManager -> Device -> FlowT OpenErrors Sys Handle
openDeviceDir dm dev = open (Just (dmDevFS dm)) path (BitSet.fromList [HandleDirectory]) BitSet.empty
   where
      path = "./dev/" ++ typ' ++ "/" ++ ids
      typ' = case deviceType dev of
         CharDevice  -> "char"
         BlockDevice -> "block"
      ids  = show (deviceMajor (deviceID dev)) ++ ":" ++ show (deviceMinor (deviceID dev))

-- | List devices
openDeviceDir dm dev = open (Just (dmDevFS dm)) path (BitSet.fromList [HandleDirectory]) BitSet.empty
   where
      path = "./dev/" ++ typ' ++ "/" ++ ids
      typ' = case deviceType dev of
         CharDevice  -> "char"
         BlockDevice -> "block"
      ids  = show (deviceMajor (deviceID dev)) ++ ":" ++ show (deviceMinor (deviceID dev))

-- | List devices