ioutil

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirExists

func DirExists(path string) bool

DirExists Returns true if the given path exists and is a directory.

func Exists

func Exists(path string) bool

Exists Returns true if the given path exists.

func ExpandUser

func ExpandUser(path string) (string, error)

ExpandUser replaces the tilde (~) in a path into the current user's home directory.

func FileExists

func FileExists(path string) bool

FileExists Returns true if the given path exists and is a regular file.

func GetAbsPath

func GetAbsPath() string

GetAbsPath 获取绝对路径

func GetExePath

func GetExePath() string

GetExePath 获取可执行程序路径

func GetFileList

func GetFileList(root string) []string

GetFileList 获取文件夹下面的所有文件的列表

func GetFolderNameList

func GetFolderNameList(root string) []string

GetFolderNameList 获取当前文件夹下面的所有文件夹名的列表

func GetWorkingDirPath

func GetWorkingDirPath() string

GetWorkingDirPath 获取工作路径

func IsAppend

func IsAppend(mode os.FileMode) bool

func IsAppendable

func IsAppendable(filename string) bool

IsAppendable Returns true if the given file can be opened for appending by the current user.

func IsCharDevice

func IsCharDevice(mode os.FileMode) bool

func IsDevice

func IsDevice(mode os.FileMode) bool

func IsExclusive

func IsExclusive(mode os.FileMode) bool

func IsNamedPipe

func IsNamedPipe(mode os.FileMode) bool

func IsNonemptyDir

func IsNonemptyDir(path string) bool

IsNonemptyDir Returns true if the given path is a directory with items in it.

func IsNonemptyExecutableFile

func IsNonemptyExecutableFile(path string) bool

IsNonemptyExecutableFile Returns true if the given path is a regular file, is executable by any user, and has a non-zero size.

func IsNonemptyFile

func IsNonemptyFile(path string) bool

IsNonemptyFile Returns true if the given path is a regular file with a non-zero size.

func IsReadable

func IsReadable(filename string) bool

IsReadable Returns true if the given file can be opened for reading by the current user.

func IsSetgid

func IsSetgid(mode os.FileMode) bool

func IsSetuid

func IsSetuid(mode os.FileMode) bool

func IsSocket

func IsSocket(mode os.FileMode) bool

func IsSticky

func IsSticky(mode os.FileMode) bool
func IsSymlink(mode os.FileMode) bool

func IsTemporary

func IsTemporary(mode os.FileMode) bool

func IsWritable

func IsWritable(filename string) bool

IsWritable Returns true if the given file can be opened for writing by the current user.

func LinkExists

func LinkExists(path string) bool

LinkExists Returns true if the given path exists and is a symbolic link.

func MatchPath

func MatchPath(pattern string, path string) bool

MatchPath Returns whether a given path matches a glob pattern.

via github.com/gobwas/glob:

Compile creates Glob for given pattern and strings (if any present after pattern) as separators. The pattern syntax is:

pattern:
    { term }

term:
    `*`         matches any sequence of non-separator characters
    `**`        matches any sequence of characters
    `?`         matches any single non-separator character
    `[` [ `!` ] { character-range } `]`
                character class (must be non-empty)
    `{` pattern-list `}`
                pattern alternatives
    c           matches character c (c != `*`, `**`, `?`, `\`, `[`, `{`, `}`)
    `\` c       matches character c

character-range:
    c           matches character c (c != `\\`, `-`, `]`)
    `\` c       matches character c
    lo `-` hi   matches character c for lo <= c <= hi

pattern-list:
    pattern { `,` pattern }
                comma-separated (without spaces) patterns

func PathExist

func PathExist(path string) bool

PathExist 路径是否存在

func ReadFile

func ReadFile(path string) []byte

ReadFile 读取文件

Types

This section is empty.

Jump to

Keyboard shortcuts

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