hyperdrive-duplicate
Check if a file on the filesystem is the same as an entry in hyperdrive by comparing stat
objects and file contents.
- Compare
archive.stat
andfs.stat
first, then - Compare
archive.createReadStream
andfs.createReadStream
(will fail as soon as stream differs).
Warning! Can be decrease performance to check duplicates of many large files.
Usage
var isDuplicate = var archive = archive
API
isDuplicate(archive, filePath, [entryName], cb)
Callback returns (err, isDuplicate)
where isDuplicate
is a boolean, true if the file is a duplicate.
If filePath
is different from the entry name in hyperdrive, specify both.
License
MIT