file

package
v1.8.68 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: Zlib Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotModified = errors.New("file not modified")

Functions

func CopyFile added in v1.0.54

func CopyFile(old, new string) error

CopyFile is used to copy a file

func CopyN added in v1.0.59

func CopyN(writer io.Writer, src io.Reader, size int64) (int64, error)

func CreateFile added in v1.8.68

func CreateFile(filename string, perm os.FileMode) (*os.File, error)

func CreatePath added in v1.6.11

func CreatePath(path string) error

func DecodeFileModifyTime added in v1.8.65

func DecodeFileModifyTime(filename string, lastModifyTime int64, decoder DecodeFunc) (int64, interface{}, error)

func DirEmpty added in v1.1.11

func DirEmpty(path string) bool

DirEmpty 目录是否为空

func IsDir

func IsDir(f string) int

func IsExist

func IsExist(f string) bool

IsExist 文件或目录

func IsFile

func IsFile(f string) bool

func Open added in v1.1.11

func Open(filename string) (*os.File, int64, error)

func Read added in v1.0.56

func Read(f io.Reader, size int) ([]byte, error)

func ReadFile added in v1.0.56

func ReadFile(f *os.File) ([]byte, error)

func ReadFileModifyTime added in v1.8.65

func ReadFileModifyTime(filename string, lastModifyTime int64) (int64, []byte, error)

func ReadFileName added in v1.8.68

func ReadFileName(filename string, reader func(r io.Reader) error) (int64, error)

func Write added in v1.1.33

func Write(filename string, src io.Reader, perm os.FileMode) error

func WriteFileName added in v1.8.68

func WriteFileName(filename string, perm os.FileMode, writer func(w io.Writer) error) error

Types

type DecodeFunc added in v1.8.65

type DecodeFunc func(v []byte) (interface{}, error)

Directories

Path Synopsis
*
*

Jump to

Keyboard shortcuts

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