Skip to main content

filesys

函数名函数描述/介绍
filesys.CopyToRefLocal
filesys.CopyToTemporary
filesys.GlanceGlance is for quickly viewing the basic info in fs
filesys.RecursiveRecursive recursively walk through the file system raw: the root path opts: options return: error
filesys.dir
filesys.onDirStatonDirStat will be called when the walker met one directory.
filesys.onFS
filesys.onFileStatonFileStat will be called when the walker met one file.
filesys.onFileStatExonFileStatEx will be called when the walker met one file and control stop
filesys.onReadyonReady will be called when the walker is ready to start walking.
filesys.onStatonStat will be called when the walker met one file description.
filesys.onStatExonStatEx will be called when the walker met one file description.

函数定义#

CopyToRefLocal#

详细描述#

定义#

CopyToRefLocal(srcFs filesys_interface.FileSystem, dest string) (*RelLocalFs, error)

参数#

参数名参数类型参数解释
srcFsfilesys_interface.FileSystem
deststring

返回值#

返回值(顺序)返回值类型返回值解释
r1*RelLocalFs
r2error

CopyToTemporary#

详细描述#

定义#

CopyToTemporary(srcFs filesys_interface.FileSystem) *RelLocalFs

参数#

参数名参数类型参数解释
srcFsfilesys_interface.FileSystem

返回值#

返回值(顺序)返回值类型返回值解释
r1*RelLocalFs

Glance#

详细描述#

Glance is for quickly viewing the basic info in fs

定义#

Glance(localfile any) string

参数#

参数名参数类型参数解释
localfileany

返回值#

返回值(顺序)返回值类型返回值解释
r1string

Recursive#

详细描述#

Recursive recursively walk through the file system

raw: the root path

opts: options

return: error

Example:

err := filesys.Recursive( //
    "testdata",    filesys.dir(["cc", "dd"], filesys.onFileStat((name, info) => {})),
)

定义#

Recursive(raw string, opts ...Option) error

参数#

参数名参数类型参数解释
rawstring
opts...Option

返回值#

返回值(顺序)返回值类型返回值解释
r1error

dir#

详细描述#

定义#

dir(globDir string, opts ...Option) Option

参数#

参数名参数类型参数解释
globDirstring
opts...Option

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

onDirStat#

详细描述#

onDirStat will be called when the walker met one directory.

定义#

onDirStat(h func(pathname string, info os.FileInfo)) Option

参数#

参数名参数类型参数解释
hfunc(pathname string, info os.FileInfo)

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

onFS#

详细描述#

定义#

onFS(f fi.FileSystem) Option

参数#

参数名参数类型参数解释
ffi.FileSystem

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

onFileStat#

详细描述#

onFileStat will be called when the walker met one file.

定义#

onFileStat(h func(pathname string, info os.FileInfo)) Option

参数#

参数名参数类型参数解释
hfunc(pathname string, info os.FileInfo)

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

onFileStatEx#

详细描述#

onFileStatEx will be called when the walker met one file and control stop

定义#

onFileStatEx(h func(pathname string, info os.FileInfo, stop func())) Option

参数#

参数名参数类型参数解释
hfunc(pathname string, info os.FileInfo, stop func())

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

onReady#

详细描述#

onReady will be called when the walker is ready to start walking.

定义#

onReady(h func(name string, isDir bool)) Option

参数#

参数名参数类型参数解释
hfunc(name string, isDir bool)

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

onStat#

详细描述#

onStat will be called when the walker met one file description.

定义#

onStat(h func(isDir bool, pathname string, info os.FileInfo)) Option

参数#

参数名参数类型参数解释
hfunc(isDir bool, pathname string, info os.FileInfo)

返回值#

返回值(顺序)返回值类型返回值解释
r1Option

onStatEx#

详细描述#

onStatEx will be called when the walker met one file description.

定义#

onStatEx(h func(isDir bool, pathname string, info os.FileInfo, stop func())) Option

参数#

参数名参数类型参数解释
hfunc(isDir bool, pathname string, info os.FileInfo, stop func())

返回值#

返回值(顺序)返回值类型返回值解释
r1Option