         # File lib/ferret/index.rb, line 792
    792:     def persist(directory, create = true)
    793:       synchronize do
    794:         close_all()
    795:         old_dir = @dir
    796:         if directory.is_a?(String)
    797:           @dir = FSDirectory.new(directory, create)
    798:         elsif directory.is_a?(Ferret::Store::Directory)
    799:           @dir = directory
    800:         end
    801:         @dir.extend(MonitorMixin) unless @dir.kind_of? MonitorMixin
    802:         @options[:dir] = @dir
    803:         @options[:create_if_missing] = true
    804:         add_indexes([old_dir])
    805:       end
    806:     end