df

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 2 Imported by: 0

README

[!CAUTION] github.com/ecnepsnai/df is deprecated and replaced by git.ecn.io/ian/df. All users should migrate to git.ecn.io/ian/df for continued updates. Tag v1.0.0 is drop-in compatible copy of the last release of github.com/ecnepsnai/df.

DF

Go Report Card Godoc Releases LICENSE

Package df provides a way to getting disk usage and capacity information for a provided file path. It currently only supports UNIX-like operating systems.

Documentation for usage

Documentation

Overview

Package df provides a way to getting disk usage and capacity information for a provided file path. It currently only supports UNIX-like operating systems.

Deprecated: github.com/ecnepsnai/df is deprecated and replaced by git.ecn.io/ian/df. All users should migrate to git.ecn.io/ian/df for continued updates. Tag v1.0.0 is drop-in compatible copy of the last release of github.com/ecnepsnai/df.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stats

type Stats struct {
	// The number of bytes available
	AvailableB uint64
	// The number of bytes consumed
	UsedB uint64
	// The maximum number of bytes that can be used
	CapacityB uint64
	// The percentage of bytes that has been used of the total capacity
	UsedPerc float64
	// The percentage of bytes that has not been used from the total capacity.
	FreePerc float64
}

Stats describes disk usage and capacity statistics

func FromPath

func FromPath(inPath string) (*Stats, error)

FromPath gather disk usage and capacity stats for the given file path

func MustFromPath

func MustFromPath(inPath string) Stats

MustFromPath gather disk usage and capacity stats for the given file path. Panics on error.

func (Stats) String

func (t Stats) String() string

Jump to

Keyboard shortcuts

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