changeset 30:526ba3c717ba draft

added check for fs walk errors
author zaitsev.serge
date Sun, 30 Aug 2015 21:16:51 +0000
parents dd669a7e582f
children b2f491299cee
files zs.go
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/zs.go	Sun Aug 30 14:01:05 2015 +0000
+++ b/zs.go	Sun Aug 30 21:16:51 2015 +0000
@@ -243,6 +243,11 @@
 			if filepath.Base(path)[0] == '.' || strings.HasPrefix(path, ".") {
 				return nil
 			}
+			// inform user about fs walk errors, but continue iteration
+			if err != nil {
+				log.Println("ERROR:", err)
+				return nil
+			}
 
 			if info.IsDir() {
 				os.Mkdir(filepath.Join(PUBDIR, path), 0755)