Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileIO ¶
type FileIO interface { Path() Path WriteText(text string, mode IoMode) error WriteBinary(data []byte, mode IoMode) error ReadText() (string, error) ReadBinary() ([]byte, error) }
FileIO 表示对一个具体文件的IO
type FileMeta ¶
type FileMeta interface { LastModTime() int64 Size() int64 IsFile() bool IsDir() bool IsSymlink() bool Exists() bool CanExecute() bool CanRead() bool CanWrite() bool }
FileMeta 表示对一个具体文件的 posix liked mode
type FileSystem ¶
type FileSystem interface { Roots() []Path GetPath(path string) Path Separator() string SeparatorChar() rune PathSeparator() string PathSeparatorChar() rune }
FileSystem 代表一个抽象的文件系统
type Path ¶
type Path interface { Parent() Path FileSystem() FileSystem Path() string Name() string Exists() bool IsDir() bool IsFile() bool IsSymlink() bool LastModTime() int64 // ms from unix time(1970-01-01 00:00:00) GetMeta() FileMeta SetMeta(meta FileMeta) Delete() error Size() int64 GetIO() FileIO CreateFile(mode IoMode) error CreateFileWithSize(size int64, mode IoMode) error CopyTo(target Path) error MoveTo(target Path) error Mkdir() error Mkdirs() error GetNameList() []string // 返回短文件名 GetPathList() []string // 返回完整路径名 GetItemList() []Path GetChild(name string) Path GetHref(name string) Path }
Path 代表一个路径
Click to show internal directories.
Click to hide internal directories.