gomounts

package module
v0.0.0-...-349507f Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2018 License: MIT Imports: 4 Imported by: 8

README

gomounts

Small, cross-platform library to grab filesystem mount points in Go

You can view the documentation here:

http://godoc.org/github.com/cratonica/gomounts

Documentation

Overview

Package gomounts implements a cross-platform library for retrieving mounted filesystem volumes.

Author: Clint Caywood

https://github.com/cratonica/gomounts

Example
package main

import (
	"github.com/strib/gomounts"
	"log"
)

func main() {
	volumes, err := gomounts.GetMountedVolumes()
	if err == nil {
		for _, v := range volumes {
			// Windows might print "Volume of type NTFS is mounted at C:\"
			// Unix might print "Volume of type ext3 is mounted at /media/HD1"
			log.Printf("Volume of type %s is mounted at %s", v.Type, v.Path)
		}
	}
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Volume

type Volume struct {
	Path  string // The mount point of the volume
	Type  string // The filesystem type
	Owner string
}

Represents a mounted volume on the host system

func GetMountedVolumes

func GetMountedVolumes() ([]Volume, error)

Gets a slice of all volumes that are currently mounted on the host system.

Jump to

Keyboard shortcuts

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