diff --git a/main.go b/main.go index 1dddfd3..93ffda1 100644 --- a/main.go +++ b/main.go @@ -177,11 +177,14 @@ func startWatcher(directory *DirectoryConfig) { directory._regexMatches = directory._regex.FindStringSubmatch(p) } if directory._regex == nil || directory._regexMatches != nil { - var statErr error + var missing bool if directory.IgnoreMissing { - _, statErr = os.Stat(p) + if _, statErr := os.Stat(p); os.IsNotExist(statErr) { + missing = true + log.Printf("[ INFO ] path=\"%s\" missing=\"true\"\n", p) + } } - if directory.IgnoreMissing || !os.IsNotExist(statErr) { + if directory.IgnoreMissing || !missing { for _, action := range directory.Actions { action.Directory = directory contin, _ := runAction(&action, eventInfo, nil)