posix

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsPathToTilde

func AbsPathToTilde(absPath string) string

func CheckSubPath

func CheckSubPath(parent, sub string) (bool, error)

Check if sub is a subdirectory of parent

func DirEmpty

func DirEmpty(name string) (bool, error)

check name path is empty directory

func DirSize

func DirSize(path string) (int64, error)

same as du -B1 or du -sh The size is calculated as the disk space used by the directory and its contents, that is, the size of the blocks, in bytes (in the same way as the `du -B1` command calculates).

func DirSizeFallback

func DirSizeFallback(path string) (int64, error)

Look at both block-size and apparent-size and choose the larger one. Because there are file systems for which block size cannot be obtained. max(du -sB1, du -sb)

func FileHead

func FileHead(path string, width int, maxLines int) string

func FileType

func FileType(st fs.FileInfo) string

func IsBinary

func IsBinary(content io.ReadSeeker, fileSize int64) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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