filex

package
v0.0.0-...-aa583d5 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateIfNotExist

func CreateIfNotExist(file string) (*os.File, error)

CreateIfNotExist creates a file if it is not exists.

func ReadAll

func ReadAll(fileName string) (values []byte, err error)

ReadAll 一次性读取文件中所有内容返回.

func ReadLine

func ReadLine(fileName string) (values []string, err error)

ReadLine 按行读取文件内容并返回所有内容.

func WriteLineByAppend

func WriteLineByAppend(fileName string, values []string) (err error)

WriteLineByAppend 按行写入文件.

1.文件不存在,会创建一个新的文件后写入.
2.文件存在,会在原文件内容后追加写入.

func WriteLineByTruncate

func WriteLineByTruncate(fileName string, values []string) (err error)

WriteLineByTruncate 按行写入文件.

1.文件不存在,会创建一个新的文件后写入.
2.文件存在,会清空原文件内容后写入.

Types

This section is empty.

Jump to

Keyboard shortcuts

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