gfile

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 4 Imported by: 0

README

文件类功能封装

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append added in v0.0.5

func Append(file string, data []byte) error

写文件 新内容追加在原有内容后面

func CreateDir

func CreateDir(path string) error

创建目录 自动递归创建父级目录

func CreateFile

func CreateFile(path string) error

创建文件 自动递归创建父级目录

func FileExists

func FileExists(path string) bool

文件是否存在

func ReadFileAll

func ReadFileAll(filepath string) ([]byte, error)

读取文件所有内容

func ReadTextFile

func ReadTextFile(file string, fn func(text string)) error

逐行读取文本文件

func Write added in v0.0.5

func Write(file string, data []byte) error

写文件 写之前清空已有内容

Types

This section is empty.

Jump to

Keyboard shortcuts

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