gfops

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

README

gfops

介绍

初步简化使用go语言操作文件和文件夹

软件架构

软件架构说明

安装教程
  1. 文件中引入

    import "gitee.com/Mxjuzi/gfops"
    
  2. 终端输入

    go mod tidy
    
使用说明
  1. xxxx
  2. xxxx
  3. xxxx
参与贡献
  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
特技
  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gfops added in v0.0.4

type Gfops struct {
}

func NewGoFileOps

func NewGoFileOps() (gfops Gfops)

func (Gfops) GetFilePathList added in v0.0.4

func (goFileOps Gfops) GetFilePathList(srcFilePath string, f func(filePathList []string)) (filePathList []string)

GetFilePathList 根据传入的路径获取文件夹下所有的文件路径(根路径),返回文件路径数组 测试功能,尚未完善

func (Gfops) MkAllDir added in v0.0.4

func (goFileOps Gfops) MkAllDir(f func(dirPath string), DirPaths ...interface{})

MkAllDir 创建目录

func (Gfops) OpenFile added in v0.0.4

func (goFileOps Gfops) OpenFile(filepaths ...interface{}) (file *os.File)

OpenFile 打开文件

func (Gfops) ReadFileData added in v0.0.4

func (goFileOps Gfops) ReadFileData(f func(readerString string, fileName string, file *os.File), filePaths ...interface{})

ReadFileData 打开文件并读取文件内容(按行读取),未提供打印功能 readString:文件中一行的内容 fileName:文件名称

func (Gfops) TouchFile added in v0.0.4

func (goFileOps Gfops) TouchFile(f func(), DirPath string, fileNames ...interface{})

TouchFile 创建文件 需要文件名和文件路径

func (Gfops) WriteFileData added in v0.0.4

func (goFileOps Gfops) WriteFileData(f func(writer *bufio.Writer), filePaths ...interface{})

WriteFileData 向文件中写入内容,测试功能,以覆盖的方式写入,提供writer接口,具体写入内容在匿名函数中自定义

Jump to

Keyboard shortcuts

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