hyperdrive
hyperdrive copied to clipboard
An easy way to check if the entire archive is present?
I'd like to check whether all files and metadata are present in a non-live archive. The way that I'm currently doing this is by calling list
, then creating a read stream for each entry and waiting until all the streams emit end
. I'm guessing that there's probably a better way for me to do this? Or, if not, is this worth adding?
You could use the archive.on('download-finished')
event would work for now.
@mafintosh and I talked about adding archive.downloadFinished
yesterday, so we should do that!
Thanks! That seems to be working. The archive.downloadFinished
property that you propose would be even better, though, because otherwise the user needs to store completion state in an external database.
Also, incidentally, I don't think that the list
-based suggestion that I proposed actually works (see #86).