filelock

package module
v0.0.0-...-cfe824d Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MulanPSL-2.0 Imports: 13 Imported by: 18

README

FileLock

💡 Introduction

Read and write files with lock.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AndroidServerPort = 6906 // Android HTTP 服务器端口

Functions

func CloseFile

func CloseFile(file *os.File) (err error)

func Copy

func Copy(src, dest string) (err error)

func CopyNewtimes

func CopyNewtimes(src, dest string) (err error)

func CopyWithoutHidden

func CopyWithoutHidden(src, dest string) (err error)

func IsExist

func IsExist(filePath string) (ret bool)

func IsHidden

func IsHidden(filePath string) (ret bool)

func Lock

func Lock(filePath string)

func OpenFile

func OpenFile(filePath string, flag int, perm os.FileMode) (file *os.File, err error)

func ReadFile

func ReadFile(filePath string) (data []byte, err error)

func Remove

func Remove(p string) (err error)

func Rename

func Rename(p, newP string) (err error)

func Unlock

func Unlock(filePath string)

func Walk

func Walk(root string, fn filepath.WalkFunc) error

func WriteFile

func WriteFile(filePath string, data []byte) (err error)

func WriteFileByReader

func WriteFileByReader(filePath string, reader io.Reader) (err error)

Types

type RemoteFile

type RemoteFile struct {
	// contains filtered or unexported fields
}

func (*RemoteFile) IsDir

func (f *RemoteFile) IsDir() bool

func (*RemoteFile) ModTime

func (f *RemoteFile) ModTime() time.Time

func (*RemoteFile) Mode

func (f *RemoteFile) Mode() fs.FileMode

func (*RemoteFile) Name

func (f *RemoteFile) Name() string

func (*RemoteFile) Path

func (f *RemoteFile) Path() string

func (*RemoteFile) Size

func (f *RemoteFile) Size() int64

func (*RemoteFile) Sys

func (f *RemoteFile) Sys() interface{}

Jump to

Keyboard shortcuts

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