Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

ipfs.files.ls() with long option doesn't include type, size, hash #1049

Closed
ksvirsky opened this issue Jul 16, 2019 · 4 comments
Closed

ipfs.files.ls() with long option doesn't include type, size, hash #1049

ksvirsky opened this issue Jul 16, 2019 · 4 comments

Comments

@ksvirsky
Copy link

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.

@alanshaw
Copy link
Contributor

What version IPFS node are you communicating with?

@ksvirsky
Copy link
Author

ksvirsky commented Jul 17, 2019

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

@alanshaw
Copy link
Contributor

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.

@alanshaw
Copy link
Contributor

Sent a PR to fix ipfs/kubo#6528

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants