Preserve file extension
This commit is contained in:
2
main.go
2
main.go
@@ -150,7 +150,7 @@ func processFile(filePath, destDir, counterPath string, counter *int) {
|
|||||||
*counter++
|
*counter++
|
||||||
saveCounter(counterPath, *counter)
|
saveCounter(counterPath, *counter)
|
||||||
|
|
||||||
newName := fmt.Sprintf("%05d", *counter)
|
newName := fmt.Sprintf("%05d%s", *counter, filepath.Ext(filePath))
|
||||||
destPath := filepath.Join(destDir, newName)
|
destPath := filepath.Join(destDir, newName)
|
||||||
|
|
||||||
_, err := os.Stat(destPath)
|
_, err := os.Stat(destPath)
|
||||||
|
Reference in New Issue
Block a user