file

package
v0.0.0-...-ebd5e3c Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(first string, more ...string) error

func CurrentDir

func CurrentDir() string

CurrentDir get the current file dir of the caller

func DelFile

func DelFile(absPath string) error

DelFile removes path and any children it contains.

func Exist

func Exist(filePath string) bool

Exist determine whether the file exists

func FormatFileSize

func FormatFileSize(fileSize int64) (size string)

func GetCurrentDirectory

func GetCurrentDirectory() string

func GetPathDirs

func GetPathDirs(absPath string) ([]string, error)

func InsertSuffix

func InsertSuffix(src string, suffix string) string

InsertSuffix insert a suffix to filepath

func IsDir

func IsDir(path string) bool

IsDir Determine whether it is a directory

func IsFile

func IsFile(path string) bool

IsFile Determine whether it is a file

func MakeDir

func MakeDir(fileDir string) error

MakeDir Recursively create new folders based on the incoming folder name

func MakeDirByFile

func MakeDirByFile(filePath string) error

MakeDirByFile create a folder recursively based on the incoming file name ./dir/filename /home/dir/filename

func Read

func Read(filename string) (string, error)

Read file contents

func ReplaceExt

func ReplaceExt(src string, ext string) string

ReplaceExt replace ext

func SavaToFile

func SavaToFile(filePath string, bytes []byte) error

SavaToFile Save the byte array to the file

func Size

func Size(path string) int64

Types

This section is empty.

Jump to

Keyboard shortcuts

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