hyperdrive icon indicating copy to clipboard operation
hyperdrive copied to clipboard

An easy way to check if the entire archive is present?

Open paulkernfeld opened this issue 7 years ago • 2 comments

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?

paulkernfeld avatar Jul 16 '16 19:07 paulkernfeld

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!

joehand avatar Jul 16 '16 20:07 joehand

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).

paulkernfeld avatar Jul 18 '16 02:07 paulkernfeld