System.MountPoints

mountpoints-1.0.2: list mount points

Safe Haskell | Safe
Language | Haskell98

System.MountPoints

Description

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

Eq Mntent |
Ord Mntent |
Show 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.