System.MountPoints

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 #

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

getMounts :: IO [Mntent] #

Get currently mounted filesystems.

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

getProcMounts :: IO [Mntent] #

Read /proc/mounts to get currently mounted filesystems.

This works on Linux and related systems, including Android.