fsutil

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 7 Imported by: 0

README

fsutil

GoDoc Build Status Go Report Card codecov License

Filesystem utility for common file and directory checks. The fsutil/disk package provides functionality for reporting disk usage on multiple platforms.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirEmpty

func DirEmpty(dir string) (bool, error)

DirEmpty check if a directory is empty.

func DirExists

func DirExists(dir string) (bool, error)

DirExists checks if a directory exists.

func DirWritable

func DirWritable(dir string) error

DirWritable checks if a directory is writable. If the directory does not exist it is created with writable permission.

func ExpandHome added in v0.1.1

func ExpandHome(path string) (string, error)

ExpandHome expands the path to include the home directory if the path is prefixed with `~`. If it isn't prefixed with `~`, the path is returned as-is.

func FileChanged

func FileChanged(filePath string, modTime time.Time) (time.Time, bool, error)

FileChanged returns the modification time of a file and true if different from the given time.

func FileExists

func FileExists(filename string) bool

FileExists returns true if the file exists.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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