mounted

package module
v0.0.0-...-46426ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

README

Overview

Get information about the mounted file systems.

Features

  • list the mounted file system
  • support Linux
  • support MacOS/BSD
  • support Windows
  • command line tools (fstab)

Install

$ go get github.com/flier/mounted

Usage

fstab, err := mounted.FileSystems()

if err != nil {
    fmt.Printf("fail to get mounted file systems, %s", err)

    os.Exit(-1)
}

for _, fs := range fstab {
    fmt.Printf("%s\n", fs)
}

Tools

$ go get github.com/flier/mounted/cmd/fstab
$ fstab
...
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errno

func Errno() error

Types

type FileSystem

type FileSystem struct {
	Name    string   // name of mounted file system
	Path    string   // file system path prefix
	Type    string   // mount type
	Options []string // mount options
}

the mounted file system description

func FileSystems

func FileSystems() ([]*FileSystem, error)

get information about mounted file systems

func (*FileSystem) String

func (fs *FileSystem) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL