rename

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cli.Command{
	Name:            "rename",
	Aliases:         []string{"r"},
	Usage:           "文件重命名",
	Action:          Action,
	SkipFlagParsing: false,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "path",
			Aliases: []string{"p"},
			Usage:   "指定需要替换文件名的目录",
			Value:   "",
		},
	},
}

Functions

func Action

func Action(cli *cli.Context) error

func BatchRenameFiles

func BatchRenameFiles(dir, subStr, newName string) error

func CheckIsHidden

func CheckIsHidden(file os.FileInfo) bool

func CheckIsKeyword

func CheckIsKeyword(filename, subStr, dir, newName string) error

func GrantReadPermission added in v0.0.2

func GrantReadPermission(path string) error

GrantReadPermission 赋予文件夹可读权限

func HasReadPermission added in v0.0.2

func HasReadPermission(path string) bool

HasReadPermission 判断文件夹是否具有可读权限

func IsDir

func IsDir(path string) bool

IsDir 判断是否是文件夹

func IsPathExist

func IsPathExist(path string) bool

func ReplaceFilename

func ReplaceFilename(filename, subStr, dir, newName string) error

Types

type DirInfo

type DirInfo struct {
	Name     string // 目录名
	Path     string // 项目副路径
	RootPath string // path + name,目录绝对路径
}

func NewDirInfo

func NewDirInfo() DirInfo

Jump to

Keyboard shortcuts

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