mfile

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base

func Base(p string) string

Base 返回文件名(带扩展名)

func Ext

func Ext(p string) string

Ext 返回文件扩展名(包含点)

func HasExt

func HasExt(p, ext string) bool

HasExt 判断文件是否具有给定扩展(不区分大小写)

func ListFiles

func ListFiles(dir string) ([]string, error)

ListFiles 列出目录下(不递归)的文件名(不包含目录)

func ReadFile

func ReadFile(path string) ([]byte, error)

ReadFile 读取文件内容为字节切片

func WriteFile

func WriteFile(path string, data []byte, perm os.FileMode) error

WriteFile 将字节写入文件(覆盖),会尝试创建父目录

Types

This section is empty.

Jump to

Keyboard shortcuts

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