hyperdrive
hyperdrive copied to clipboard
Inconsistent size for directories readdir / stat
I noticed that when running a hyperdrive 10.8.20 that the stat returned by a readdir returns a different size:
const hyperdrive = require('hyperdrive')
const ram = require('random-access-memory')
const drive = hyperdrive(ram)
const assert = require('assert')
drive.writeFile('test/test.txt', 'hello', () => {
drive.readdir('/', { includeStats: true }, (_, readdir) => {
const name = readdir[0].name
assert.equal(name, 'test')
drive.stat(name, (_, stat) => {
assert.equal(readdir[0].stat.size, stat.size) // should pass but fails with 0 == 5
})
})
})