mntent

package module
v0.0.0-...-8349700 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2014 License: MIT Imports: 8 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

mntent

mntent is mtab/fstab parser for Go.

Requirements

mntent requires Go 1.1 or above.

Installation

go get github.com/antage/mntent

Usage

package main

import (
	"fmt"
	"os"
	"strings"

	"github.com/antage/mntent"
)

func main() {
	entries, err := mntent.Parse("/etc/fstab")
	if err != nil {
		fmt.Fprintf(os.Stderr, "Can't open /etc/fstab: %s\n", err)
		os.Exit(1)
	}

	for _, ent := range entries {
		fmt.Printf("FS name: %s\n", ent.Name)
		fmt.Printf("\tDir: %s\n", ent.Directory)
		fmt.Printf("\tTypes: %v\n", ent.Types)
		fmt.Printf("\tOptions: %s\n", strings.Join(ent.Options, ","))
		fmt.Printf("\tDump frequency: %d\n", ent.DumpFrequency)
		fmt.Printf("\tFSCK pass number: %d\n", ent.PassNumber)
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Name          string
	Directory     string
	Types         []string
	Options       []string
	DumpFrequency int
	PassNumber    int
}

func Parse

func Parse(filename string) ([]*Entry, error)

Jump to

Keyboard shortcuts

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