dat-node
dat-node copied to clipboard
dat.archive.mkdir() not creating a dir
Doesn't create a folder, doesn't return an error (err)
dat.archive.mkdir('/my-dir', function(err){
console.log(err);
});
I can also reproduce this using hyperdrive/dat-storage directly:
var hyperdrive = require('hyperdrive')
var storage = require('dat-storage')
var archive = hyperdrive(storage('./test'), {latest: true})
archive.mkdir('/my-dir', function (err) {
console.log(err)
})
So it looks like either a bug in dat-storage or hyperdrive.
I've been playing around and tested it both your way and the one below. It doesn't work even when dat-storage
is eliminated, so it seems to originate from hyperdrive
and not dat-storage
.
var hyperdrive = require('hyperdrive')
var storage = require('dat-storage')
var archive = hyperdrive('123', {latest: true})
archive.mkdir('/my-dir', function (err) {
console.log(err)
})
Funny thing is that if I check out version 1 of the archive and readdir
it does appear?
var hyperdrive = require('hyperdrive')
var storage = require('dat-storage')
var archive = hyperdrive('123', {latest: true})
archive.checkout(1).readdir('/', (err, res) => {
if (err) throw err
console.log(res)
})