mountpoints-1.0.2: list mount points

Copyright | 2012 Joey Hess <id@joeyh.name>
License | LGPL 2.1 or higher
Safe Haskell | Safe-Inferred
Language | Haskell98

System.MountPoints

Description

Derived from hsshellscript, originally written by Volker Wysk hsss@volker-wysk.de

Synopsis

- data Mntent = Mntent {
  - mnt_fsname :: String
  - mnt_dir :: FilePath
  - mnt_type :: String
  }
- getMounts :: IO [Mntent]
- getProcMounts :: IO [Mntent]

# Documentation

data Mntent Source #

This is a stripped down mntent, containing only fields available everywhere.

Constructors

Mntent |

Fields

- mnt_fsname :: String

  what's mounted

- mnt_dir :: FilePath

  where it's mounted

- mnt_type :: String

  what sort of filesystem is mounted

#### Instances

Instances details

Show Mntent Source # |
Instance details Defined in System.MountPoints Methods showsPrec :: Int -> Mntent -> ShowS Source # show :: Mntent -> String Source # showList :: [Mntent] -> ShowS Source #
Eq Mntent Source # |
Instance details Defined in System.MountPoints Methods (==) :: Mntent -> Mntent -> Bool Source # (/=) :: Mntent -> Mntent -> Bool Source #
Ord Mntent Source # |
Instance details Defined in System.MountPoints Methods compare :: Mntent -> Mntent -> Ordering Source # (<) :: Mntent -> Mntent -> Bool Source # (<=) :: Mntent -> Mntent -> Bool Source # (>) :: Mntent -> Mntent -> Bool Source # (>=) :: Mntent -> Mntent -> Bool Source # max :: Mntent -> Mntent -> Mntent Source # min :: Mntent -> Mntent -> Mntent Source #

getMounts :: IO [Mntent] Source #

Get currently mounted filesystems.

This uses eiher getmntent or getmntinfo, depending on the OS.

getProcMounts :: IO [Mntent] Source #

Read /proc/mounts to get currently mounted filesystems.

This works on Linux and related systems, including Android.