sdfile

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package sdfile 文件及读写工具

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsByBin

func AbsByBin(filename string) string

func AppendBytes

func AppendBytes(filename string, data []byte, perm os.FileMode) error

func AppendText

func AppendText(filename string, text string, perm os.FileMode) error

func BinDir

func BinDir() string

func Exists

func Exists(filename string) bool

func FirstExists

func FirstExists(filenames ...string) string

func IsDir

func IsDir(filename string) bool

func ReadBytes

func ReadBytes(filename string) ([]byte, error)

func ReadBytesDef

func ReadBytesDef(filename string, def []byte) []byte

func ReadText

func ReadText(filename string) (string, error)

func ReadTextDef

func ReadTextDef(filename, def string) string

func UseTempDir

func UseTempDir(dir, pattern string, action func(string)) error

func UseTempDirForResult

func UseTempDirForResult[R any](dir, pattern string, action func(string) (R, error)) (R, error)

func UseTempFile

func UseTempFile(dir, pattern string, action func(*os.File)) error

func UseTempFileForResult

func UseTempFileForResult[R any](dir, pattern string, action func(*os.File) (R, error)) (R, error)

func WriteBytes

func WriteBytes(filename string, data []byte, perm os.FileMode) error

func WriteText

func WriteText(filename string, text string, perm os.FileMode) error

Types

This section is empty.

Directories

Path Synopsis
Package sdfiletype 通过内容判别文件类型
Package sdfiletype 通过内容判别文件类型
Package sdhttpfile 从http文件系统中读取内容
Package sdhttpfile 从http文件系统中读取内容

Jump to

Keyboard shortcuts

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