filer

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(path string) bool

判断文件是否存在

func Read added in v0.4.1

func Read(path string) (string, error)

读取文本内容

func Write added in v0.4.1

func Write(path string, content string) error

写入文本内容

Types

type FileInfo added in v0.3.9

type FileInfo struct {
	Name    string      // 文件名
	Size    int64       // 字节大小
	Mode    os.FileMode // 权限,如:0777
	ModTime int64       // 修改时间,Unix时间戳
	IsDir   bool        // 是否是目录
	Content string      // 文本内容,仅用于文本文件
}

func Detail added in v0.4.1

func Detail(path string, text bool) (*FileInfo, error)

获取文件信息和文本内容

func List

func List(dir string) ([]*FileInfo, error)

列出目录中的所有文件

Jump to

Keyboard shortcuts

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