safemount

package
v0.0.0-...-4cb4cf9 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package that assists with mounting and unmounting cleanly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mount

type Mount struct {
	// contains filtered or unexported fields
}

func NewMount

func NewMount(source, target, fstype string, flags uintptr, data string, makeAndDeleteDir bool) (*Mount, error)

Creates a new system mount.

func (*Mount) CleanClose

func (m *Mount) CleanClose() error

Close removes the system mount and fails if the device is still busy. CleanClose and Close are safe to call multiple times.

func (*Mount) Close

func (m *Mount) Close()

Close removes the system mount. The unmount is performed asynchronously. This reduces the likelihood of the unmount failing (thus ensuring the user's system is left in a clean state). But it doesn't provide any guarantees about the validity of the written bits. CleanClose and Close are safe to call multiple times.

func (*Mount) Target

func (m *Mount) Target() string

Target returns the target directory of the mount.

Jump to

Keyboard shortcuts

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