dir

package
v0.0.0-...-6c31ca2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcBytes

func CalcBytes(bytes int64) (mb, gb, tb, pb, eb int64)

Convert bytes in MB, GB, TB, PB, EB etc...

func Compress

func Compress(source string) error

func CopyDir

func CopyDir(source string, dest string) (err error)

func CopyFile

func CopyFile(source string, dest string) (err error)

func DiskUsage

func DiskUsage(path string, info os.FileInfo) int64

dir.DiskUsage("/meu/diretorio", ".")

func FilesByExt

func FilesByExt(directory, ext string)

Find files by extension

Example: dir.FilesByExtension("C:\\Windows", "exe")

func IsDir

func IsDir(path string) bool

func IsDirEmpty

func IsDirEmpty(directory string) bool

func RemoveAllDir

func RemoveAllDir(path string)

func RemoveDir

func RemoveDir(path string)

func ReturnSizeStr

func ReturnSizeStr(size int64) (string, int64)

How use:

var a, b = ReturnSizeStr(1048106)

fmt.Printf("Size: %d %s", b, a)

TODO: Solucionar erro para GigaByte, TeraByte...

func Scan

func Scan(path string, f os.FileInfo, err error) error

func Scanner

func Scanner(directory string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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