summaryrefslogtreecommitdiff
path: root/cmd/getallhocrs/main.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2020-06-16 16:57:34 +0100
committerNick White <git@njw.name>2020-06-16 16:57:34 +0100
commit629e436f63da8f19fd1654a634edf8e4f1c2bdad (patch)
tree713d6f890bd5e3d22dcc8869815e66cb22c08880 /cmd/getallhocrs/main.go
parent8aa2d713d511baeaa94472e238e46c6d02ac9332 (diff)
[getallhocrs] Skip files which have already been downloaded
Diffstat (limited to 'cmd/getallhocrs/main.go')
-rw-r--r--cmd/getallhocrs/main.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/getallhocrs/main.go b/cmd/getallhocrs/main.go
index 136f07e..696a5fc 100644
--- a/cmd/getallhocrs/main.go
+++ b/cmd/getallhocrs/main.go
@@ -68,6 +68,13 @@ func main() {
if !strings.HasSuffix(o, ".hocr") {
continue
}
+ // skip already downloaded items
+ _, err = os.Stat(o)
+ if err == nil || os.IsExist(err) {
+ log.Println(" Skipping already complete download of", o)
+ continue
+ }
+ log.Println(" Downloading", o)
err = conn.Download(conn.WIPStorageId(), o, o)
if err != nil {
log.Fatalln("Failed to download file", o, err)