fsutil

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Overview

Package fsutil is common file system utils for Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanDir

func CleanDir(fpath string) error

CleanDir removes all children contained in the given path.

func Compress added in v0.1.7

func Compress(src, dst string) error

Compress is like Tar but will use gzip to compress.

func Copy

func Copy(src, dst string) error

Copy copies a file or directory from src to dst.

func CopyFile

func CopyFile(src, dst string) (err error)

CopyFile copies a file from src to dst.

func DeCompress added in v0.1.7

func DeCompress(src, dst string) (err error)

DeCompress is like UnTar but will use gzip to decompress.

func IsDir

func IsDir(fpath string) bool

IsDir reports whether the given path is a directory.

func IsExists

func IsExists(fpath string) bool

IsExists reports whether the given path exists.

func IsSymlink(fpath string) bool

IsSymlink reports whether the given path is a symbolic link.

func MkDirAll added in v0.1.7

func MkDirAll(fpath string) error

MkDirAll os.MkdirAll with permission 777.

func Owner

func Owner(fpath string) (uid, gid int, err error)

Owner returns the uid and gid of the given path.

func Tar added in v0.1.7

func Tar(src, dst string) error

Tar create a new archive.

func UnTar added in v0.1.7

func UnTar(src, dst string) (err error)

UnTar extract all files from an archive.

func Walk added in v0.1.7

func Walk(fpath string, fn WalkFunc) error

Walk walks the line of the given file, calling fn for each line.

Types

type WalkFunc added in v0.1.7

type WalkFunc func(line []byte) error

Jump to

Keyboard shortcuts

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