disk

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UsageStats

type UsageStats struct {
	// Path is the filesystem path that disk usage is associated with.
	Path string
	// Percent is the user usage percent compared to the total amount of space
	// the user can use. This number would be higher if compared to root's
	// because the user has less space (around 5%).
	Percent float64
	// Free is the remaining free space usable by the user.
	Free uint64
	// Total is the space only available to root.
	Total uint64
	// Used is the total space being used.
	Used uint64
}

func Usage

func Usage(path string) (*UsageStats, error)

DiskUsage returns disk usage associated with path.

About 5% of disk space is usually accessible by root but not accessible by user. The values of UsageStats.Total and UsageStats.Used are the total and used disk space, whereas UsageStats.Free and UsageStats.Percent are user view of disk space.

Jump to

Keyboard shortcuts

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