Documentation
¶
Overview ¶
Package renfls provides interfaces to rename files in directory.
Package renfls provides interfaces to rename files in directory.
Package renfls provides interfaces to rename files in directory.
Index ¶
- func Rename(oldPath, dest, newName string) (string, error)
- func RenameCondition(root, dest, newFileName string, needRename NeedRename) error
- func RenameExt(root, dest, newFileName string, exts []string) error
- func RenameIgnoreExt(root, dest, newFileName string, exts []string) error
- func RenamePattern(root, dest, newFileName, pattern string) error
- func ToDirName(root, newDir string) error
- func ToDirNameExt(root, newDir string, exts []string) error
- func ToDirNameIgnoreExt(root, newDir string, exts []string) error
- func ToDirNamePattern(root, newDir, pattern string) error
- func ToSubDirsName(root string) error
- func ToSubDirsNameExt(root string, exts []string) error
- func ToSubDirsNameIgnoreExt(root string, exts []string) error
- func ToSubDirsNamePattern(root, pattern string) error
- func WalkRename(root, dest, newFileName string, condition Condition) error
- func WalkRenameAll(root, dest, newFileName string) error
- func WalkToRootDirName(root, dest string, condition Condition) error
- func WalkToRootSubDirName(root, dest string, condition Condition) error
- type Condition
- type NeedRename
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenameCondition ¶
func RenameCondition(root, dest, newFileName string, needRename NeedRename) error
RenameCondition renames all files matching condition in root and moves these to a directory.
func RenameExt ¶
RenameExt renames all files matching extensions in root and moves these to a directory.
func RenameIgnoreExt ¶
RenameIgnoreExt renames all files not matching extension ins root and moves these to a directory.
func RenamePattern ¶
RenamePattern renames all files matching pattern in root and moves these to a directory.
func ToDirName ¶
ToDirName renames all files in root by the root directory name and moves these to a directory.
func ToDirNameExt ¶
ToDirNameExt renames all files matching extensions in root by the root directory name and moves these to a directory.
func ToDirNameIgnoreExt ¶
ToDirNameIgnoreExt renames all files not matching extensions in root by the root directory name and moves these to a directory.
func ToDirNamePattern ¶
ToDirNamePattern renames all files matching pattern in root by the root directory name and moves these to a directory.
func ToSubDirsName ¶
ToSubDirsName renames all files in root by the directories name in root and moves these to a directory.
func ToSubDirsNameExt ¶
ToSubDirsNameExt renames all files matching extensions in root by the directories name in root and moves these to a directory.
func ToSubDirsNameIgnoreExt ¶
ToSubDirsNameIgnoreExt renames all files not matching extensions in root by the directories name in root and moves these to a directory.
func ToSubDirsNamePattern ¶
ToSubDirsNamePattern renames all files matching pattern in root by the directories name in root and moves these to a directory.
func WalkRename ¶
WalkRename renames files that match a condition in a root directory and moves them to a destination directory.
func WalkRenameAll ¶
WalkRenameAll renames all files in a root directory and moves them to a destination directory.
func WalkToRootDirName ¶
WalkToRootDirName renames files that match a condition in a root directory to the root directory name and moves them to a destination directory.
func WalkToRootSubDirName ¶
WalkToRootSubDirName renames files that match a condition in a root directory to the sub directory name and moves them to a destination directory.
Types ¶
type NeedRename ¶
NeedRename returns whether the file needs to be rename.