Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return the size of each file on ipfs add #4008

Closed
daviddias opened this issue Jun 25, 2017 · 10 comments
Closed

Return the size of each file on ipfs add #4008

daviddias opened this issue Jun 25, 2017 · 10 comments
Labels
help wanted Seeking public contribution on this issue topic/api Topic api topic/commands:add Topic commands:add

Comments

@daviddias
Copy link
Member

@whyrusleeping would you be ok with adding one more value on the response of an ipfs add? The respective file size.

This would enable us to greatly reduce the bundle size of ipfs-api/add, which is what most users need.

@whyrusleeping
Copy link
Member

@diasdavid would you want something returned for directories and symlinks?

@daviddias
Copy link
Member Author

@whyrusleeping I feel it is useful to have the 'size' for those. Essentially I just grab the cumulative size https://github.com/ipld/js-ipld-dag-pb/blob/master/src/dag.proto.js#L13

@whyrusleeping
Copy link
Member

@diasdavid alright, and you just want a "size":12345 field added to the response object? Do you want it to be a number or a string?

@whyrusleeping whyrusleeping added topic/api Topic api topic/commands:add Topic commands:add help wanted Seeking public contribution on this issue labels Jun 26, 2017
@daviddias
Copy link
Member Author

Let's do a string because you know

@ghost
Copy link

ghost commented Jun 27, 2017

👍 on including that, both the ls and object/stat commands return numbers though. Might be worth it to be consistent?

@Kubuxu
Copy link
Member

Kubuxu commented Jun 27, 2017

It might be worth migrating away from returning numbers in JSON, to prevent stuff like #3354

@ghost
Copy link

ghost commented Jun 27, 2017

Which issue do you mean? 4008 is this one here

@Kubuxu
Copy link
Member

Kubuxu commented Jun 27, 2017

Sorry #3354

@whyrusleeping
Copy link
Member

@lgierth I think we should try to migrate numbers in our api to be strings. It would be a breaking change, but i think its pretty important. This is probably worth opening its own issue over

@kristianfreeman
Copy link

Hey all! Can this be closed with #4082 being merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue topic/api Topic api topic/commands:add Topic commands:add
Projects
None yet
Development

No branches or pull requests

4 participants