file

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

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	LinkTarget string
	// contains filtered or unexported fields
}

Info describe the os.FileInfo and handle some actions

func GetFileInfoByEnumDir

func GetFileInfoByEnumDir(fp string) *Info

get file info by enum dir TODO : not ok for linux, do not call in linux

func Lstat

func Lstat(fp string) *Info

Lstat do the os.Lstat and return an Info

func Stat

func Stat(fp string) *Info

Stat do the os.Stat and return an Info

func (*Info) Basic

func (i *Info) Basic() os.FileInfo

Basic return the origin os.FileInfo

func (*Info) Batch

func (i *Info) Batch() (bool, int64, int64, uint32)

Batch return Exist, Size, ModifyTime64, Mode32 in one call.

func (*Info) Error

func (i *Info) Error() error

Error return the os.Stat/os.Lstat error

func (*Info) Exist

func (i *Info) Exist() bool

Exist check if the file is exist

func (*Info) Md5

func (i *Info) Md5() (string, error)

Md5 return the md5 of this file

func (*Info) Mode32

func (i *Info) Mode32() uint32

Mode32 return the file mode

func (*Info) ModifyTime

func (i *Info) ModifyTime() int64

ModifyTime return the nano-second of this file's mod time

func (*Info) ModifyTime64

func (i *Info) ModifyTime64() int64

ModifyTime64 return the ModifyTime as int64

func (*Info) Path

func (i *Info) Path() string

Path return the file path

func (*Info) Size

func (i *Info) Size() int64

Size return the file size

Jump to

Keyboard shortcuts

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