Add renfnv tool.

This is a tool I use for renaming files when doing photographic work.

This change also renames the functions in fileutil to not be P
functions.
This commit is contained in:
Kyle Isom
2016-08-23 12:59:34 -07:00
parent f710b82899
commit e8045e0b1f
3 changed files with 155 additions and 4 deletions

View File

@@ -7,14 +7,14 @@ import (
"golang.org/x/sys/unix"
)
// FileExistsP returns true if the file exists.
func FileExistsP(path string) bool {
// FileDoesExist returns true if the file exists.
func FileDoesExist(path string) bool {
_, err := os.Stat(path)
return !os.IsNotExist(err)
}
// DirectoryExistsP returns true if the file exists.
func DirectoryExistsP(path string) bool {
// DirectoryDoesExist returns true if the file exists.
func DirectoryDoesExist(path string) bool {
fi, err := os.Stat(path)
if err != nil {
return false