fs

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearDeletedFile

func ClearDeletedFile(clearPath string) error

ClearDeletedFile remove all the deleted files in the path

func CreateFile

func CreateFile(name string) (*os.File, error)

CreateFile create a file without truncate

func FileExist

func FileExist(path string) (exist bool, err error)

FileExist is file Exist

func GetFileTime

func GetFileTime(path string) (cTime time.Time, aTime time.Time, mTime time.Time, err error)

GetFileTime get the creation time, last access time, last modify time of the path

func GetFileTimeBySys

func GetFileTimeBySys(sys any) (cTime time.Time, aTime time.Time, mTime time.Time, err error)

GetFileTimeBySys get the creation time, last access time, last modify time of the FileInfo.Sys()

func IsDeleted

func IsDeleted(path string) bool

IsDeleted is deleted path

func IsDir added in v0.3.0

func IsDir(path string) (bool, error)

IsDir the path is directory or not

func IsEOF added in v0.3.4

func IsEOF(err error) bool

IsEOF whether the error is io.EOF

func IsNonEOF added in v0.3.4

func IsNonEOF(err error) bool

IsNonEOF whether the error is not io.EOF and is not nil

func IsSub added in v0.5.0

func IsSub(parent, child string) (bool, error)

IsSub whether it is a subdirectory of the parent

func LogicallyDelete

func LogicallyDelete(path string) error

LogicallyDelete delete the path logically

func OpenRWFile

func OpenRWFile(name string) (*os.File, error)

OpenRWFile open a file with read write mode

func ToDeletedPath added in v0.4.3

func ToDeletedPath(path string) string

ToDeletedPath convert to the logically deleted file name

Types

type GetFileTimeFunc added in v0.4.4

type GetFileTimeFunc func(path string) (cTime time.Time, aTime time.Time, mTime time.Time, err error)

GetFileTimeFunc the function prototype of GetFileTime

type IsDirFunc added in v0.4.4

type IsDirFunc func(path string) (bool, error)

IsDirFunc the function prototype of IsDir

type StatFunc added in v0.4.4

type StatFunc func(name string) (os.FileInfo, error)

StatFunc the function prototype of os.Stat

Jump to

Keyboard shortcuts

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