code: func newFSDirectory(spi FSDirectorySPI, path string) (d *FSDirectory, err error) {
  	d = &FSDirectory{
  		Locker:         &sync.Mutex{},
  		path:           path,
  		staleFiles:     make(map[string]bool),
  		staleFilesLock: &sync.RWMutex{},
  		chunkSize:      math.MaxInt32,
  	}
  	d.DirectoryImpl = NewDirectoryImpl(d)
  	d.BaseDirectory = NewBaseDirectory(d)
  	d.FSDirectorySPI = spi
  
  	if fi, err := os.Stat(path); err == nil && !fi.IsDir() {
  		return d, newNoSuchDirectoryError(fmt.Sprintf("file '%v' exists but is not a directory", path))
  	}
  
  	// TODO default to native lock factory
  	d.SetLockFactory(NewSimpleFSLockFactory(path))
  	return d, nil
  }
docs: // TODO support lock factory