rardecode icon indicating copy to clipboard operation
rardecode copied to clipboard

Previous() function

Open raichu opened this issue 9 years ago • 1 comments

Another feature request: is it possible to add Previous, First, Last, JumpTo, NFiles functions?

In fact, API-wise, only JumpTo and NFiles should be enough (similar to what lib7zip provides), replacing Next as well.

The current API is quite restrictive, unless you're going to extract all the files in a sequential order (like the program unrar does by default). Random access to files is an important feature for many applications.

raichu avatar Aug 09 '15 16:08 raichu

Its possible. But I'd probably just be storing a copy of a List() function (if implemented) internally.

What I have to do is probably ditch io.Reader support and use io.ReadSeeker instead. And then have Next() return a File object like in archive/zip. The File object can then be accessed independently. Everything else would be built on that, such as List() returning a list of File's.

nwaples avatar Nov 05 '15 08:11 nwaples