code: func (f *sendReceiveFolder) checkParent(file string, scanChan chan<- string) bool {
  	parent := filepath.Dir(file)
  
  	if err := osutil.TraversesSymlink(f.fs, parent); err != nil {
  		f.newPullError(file, errors.Wrap(err, "checking parent dirs"))
  		return false
  	}
  
  	// issues #114 and #4475: This works around a race condition
  	// between two devices, when one device removes a directory and the
  	// other creates a file in it. However that happens, we end up with
  	// a directory for "foo" with the delete bit, but a file "foo/bar"
  	// that we want to sync. We never create the directory, and hence
  	// fail to create the file and end up looping forever on it. This
  	// breaks that by creating the directory and scheduling a scan,
  	// where it will be found and the delete bit on it removed. The
  	// user can then clean up as they like...
  	// This can also occur if an entire tree structure was deleted, but only
  	// a leave has been scanned.
  	if _, err := f.fs.Lstat(parent); !fs.IsNotExist(err) {
  		l.Debugf("%v parent not missing %v", f, file)
  		return true
  	}
  	l.Debugf("%v resurrecting parent directory of %v", f, file)
  	if err := f.fs.MkdirAll(parent, 0755); err != nil {
  		f.newPullError(file, errors.Wrap(err, "resurrecting parent dir"))
  		return false
  	}
  	scanChan <- parent
  	return true
  }
docs: // checkParent verifies that the thing we are handling lives inside a directory,
  // and not a symlink or regular file. It also resurrects missing parent dirs.