ioutil

package
v1.1.11 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirExists added in v1.1.6

func DirExists(path string) bool

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

func Exists added in v1.1.6

func Exists(path string) bool

Exists Returns true if the given path exists.

func ExpandUser added in v1.1.6

func ExpandUser(path string) (string, error)

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

func FileExists added in v1.1.6

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 added in v1.1.6

func IsAppend(mode os.FileMode) bool

func IsAppendable added in v1.1.6

func IsAppendable(filename string) bool

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

func IsCharDevice added in v1.1.6

func IsCharDevice(mode os.FileMode) bool

func IsDevice added in v1.1.6

func IsDevice(mode os.FileMode) bool

func IsExclusive added in v1.1.6

func IsExclusive(mode os.FileMode) bool

func IsNamedPipe added in v1.1.6

func IsNamedPipe(mode os.FileMode) bool

func IsNonemptyDir added in v1.1.6

func IsNonemptyDir(path string) bool

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

func IsNonemptyExecutableFile added in v1.1.6

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 added in v1.1.6

func IsNonemptyFile(path string) bool

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

func IsReadable added in v1.1.6

func IsReadable(filename string) bool

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

func IsSetgid added in v1.1.6

func IsSetgid(mode os.FileMode) bool

func IsSetuid added in v1.1.6

func IsSetuid(mode os.FileMode) bool

func IsSocket added in v1.1.6

func IsSocket(mode os.FileMode) bool

func IsSticky added in v1.1.6

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

func IsTemporary added in v1.1.6

func IsTemporary(mode os.FileMode) bool

func IsWritable added in v1.1.6

func IsWritable(filename string) bool

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

func LinkExists added in v1.1.6

func LinkExists(path string) bool

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

func MatchPath added in v1.1.6

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