code: func NewExclusiveLock(path string) (*UpdateableFileLock, error) {
  	flock, err := lock.TryExclusiveLock(path, lock.RegFile)
  	if err != nil {
  		return nil, err
  	}
  	fi, err := os.Stat(path)
  	if err != nil {
  		return nil, err
  	}
  	// Note: if we expected the file to ever be deleted and recreated while an
  	// ExLock isn't held, we would have to check the fd is still correct here.
  	// However, the file is created once and never deleted outside of the safely
  	// handled renames in this package, so it's safe to assume the fd hasn't
  	// changed.
  	// The rename call in this package is "safe" because it leaves no window
  	// where the file at that path does not have an exclusive lock
  	return &UpdateableFileLock{
  		lock:     flock,
  		path:     path,
  		isLocked: true,
  		perms:    fi.Mode(),
  	}, nil
  }
docs: // NewExclusiveLock creates a new exclusive filelock.
  // The given filepath must exist.