mirror of
https://github.com/fumiama/dupimage.git
synced 2026-06-08 12:00:40 +08:00
fix newdir
This commit is contained in:
6
main.go
6
main.go
@@ -9,6 +9,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
_ "image/gif"
|
||||
_ "image/jpeg"
|
||||
@@ -157,6 +158,11 @@ func main() {
|
||||
fmt.Println("ERROR:", err)
|
||||
continue
|
||||
}
|
||||
_, err = os.Stat(newdir)
|
||||
for err != nil {
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
_, err = os.Stat(newdir)
|
||||
}
|
||||
for _, i := range lst {
|
||||
err = os.Rename(i.name, newdir+"/"+i.name)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user