Skip to content

Get disk usage information like how much space is available, free, and used

License

Notifications You must be signed in to change notification settings

staugur/go-disk-usage

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-disk-usage

Go Reference

Get disk usage information like how much space is available, free, and used.

Install

go get -u pkg.tcw.im/go-disk-usage

Usage

import "pkg.tcw.im/go-disk-usage/du"

// The first way
diskUsage := du.New("/path/to/one")

// The second way (Human-readable, recommend)
diskInfo := du.DiskInfo("/path/to/two")

// Or get disk usage directly
percent := du.DiskRate("/path/to")

Compatibility

This works for Windows, MacOS, and Linux although there may some minor variability between what this library reports and what you get from df. This library will maintain reverse compatability, any breaking changes will be made to a forked repository.

About

Get disk usage information like how much space is available, free, and used

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Go 100.0%