package
Version:
v1.0.0-rc.58
Opens a new window with list of versions in this module.
Published: Nov 11, 2026
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package fsutil 读本机磁盘的剩余空间(媒体中心 M8 的首页存储与系统体检)。
ErrUnsupported 表示这个系统上读不了磁盘空间。
LowSpace 报告剩余空间是不是低于警告线(总量的 5% 或 20 GB,先到哪条算哪条)。总量不知道(0)时只看 20 GB。
type Usage struct {
Free uint64 `json:"free"`
Total uint64 `json:"total"`
Device string `json:"-"`
}
Usage 是一个路径所在磁盘的空间:Free 是当前用户能用的剩余字节,Total 是总字节;Device 认同一块盘(两个路径的 Device 一样时在
同一个文件系统上,首页按它去重,硬链接也只能在同一块盘里建)。
DiskUsage 读 path 所在磁盘的空间(path 要存在)。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.