file

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(srcFile, dstFile string) error

*

  • 复制文件

func CopyDirectory

func CopyDirectory(scrDir, dest string) error

*

  • 复制文件夹
func CopySymLink(source, dest string) error

*

  • 复制软连接

func CreateFileWithFolder

func CreateFileWithFolder(p string) (*os.File, error)

*

  • 创建文件,如果文件夹不存在则创建文件夹

func CreateFolder

func CreateFolder(dir string, perm os.FileMode) error

*

  • 创建目录

func DownLoadFileToFile

func DownLoadFileToFile(url string, path string) (err error)

*

  • 下载文件到指定文件

func DownloadFileToFolder

func DownloadFileToFolder(url string, folder string, newFilename string) (localPath string, err error)

*

  • 下载文件到指定文件夹
  • 如果 newFilename 为空,则使用 url 中的文件名

func Exists

func Exists(filePath string) bool

*

  • 判断文件是否存在

func GetFileNumber

func GetFileNumber(fileName string) (number int, err error)

从文件名中解析出数字

func MoveFile

func MoveFile(sourcePath, destPath string) (err error)

*

  • 移动文件

func ReadFolderWithLastNumberSort

func ReadFolderWithLastNumberSort(path string) (files []fs.DirEntry, err error)

*

  • 读取目录中文件并根据末尾的数字进行排序

Types

This section is empty.

Jump to

Keyboard shortcuts

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