# File lib/ole/storage/file_system.rb, line 289
      def chdir orig_path
        # make path absolute, squeeze slashes, and remove trailing slash
        path = @ole.file.expand_path(orig_path).squeeze('/').sub(/\/$/, '')
        # this is just for the side effects of the exceptions if invalid
        dirent_from_path path, orig_path
        if block_given?
          old_pwd = @pwd
          begin
            @pwd = path
            yield
          ensure
            @pwd = old_pwd
          end
        else
          @pwd = path
          0
        end
      end