ipfs.files.ls() with long option doesn't include type, size, hash
ksvirsky opened this issue · 4 comments
Hi!
The following code snippet was used to list files:
const files = await ipfs.files.ls('/', {long: true});
console.log(files);
It produces the following result:
[
{ name: 'TestFile', type: 0, size: 0, hash: '' },
{ name: 'dir01', type: 0, size: 0, hash: '' },
{ name: 'dir02', type: 0, size: 0, hash: '' },
{ name: 'new1', type: 0, size: 0, hash: '' }
]
AFAIU type, size and hash should be included in response because long option is set.
What version IPFS node are you communicating with?
ipfs version 0.4.21
By the way corresponding cli command with results:
$ ipfs files ls -l
TestFile QmZk1aHzVk6eYiKQLZUCyo4bzRpLJvSrXWcyFcsjQ3Jzhk 12
dir01/ QmVxc4sCHWe3X3vvdu483jyovDUFoVG1RgCcyrKwqyjRgs 0
dir02/ QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn 0
new1/ QmSGLjJjk5ynJNg4Sug1BV6WkMyFi5oDkMgWCB2Ys8aC18 0
Short answer is that go-ipfs doesn't support "long", but if you pass "l" it will work.
Follow along https://github.com/ipfs/go-ipfs#issuecomment-392477565 for progress on adding the longhand option name.
Sent a PR to fix ipfs/kubo#6528