Closed btzr-io closed 4 years ago
I believe libarchive is returning files "as is" written inside file, meaning order is specific to however archive was created, do you have any reason to think it might not be that case ?
Got the same result with: https://wcchoi.github.io/libunrar-js/
Just in case someone has the same problem:
// Get files list
const files = await archive.current.getFilesArray()
// Sort files by name
files.sort((a, b) => {
if (a.file.name > b.file.name) return 1
if (a.file.name < b.file.name) return -1
return 0
})
getFilesArray()
is returning unsorted items for some rar archives. Example archive: https://github.com/workhorsy/uncompress.js/blob/master/example_rar_5.rarAny ideas why ?