-
Notifications
You must be signed in to change notification settings - Fork 124
Make the size field of ls correspond to to the size of the file #427
Comments
I'd make it 0 as some things may expect uint |
I’m massively in favour of this. Returning the DAG size is only useful to protocol spelunkers and is not verified by the codec so is not trustworthy. For directories I’d prefer to omit the size field in the response instead of using 0 or -1. |
@magik6k will omitting them be fine? We could also use the DAG size for directories (given that we can do whatever we want, really). Historical note from @whyrusleeping: |
I'd keep directory sizes in the response json, just not display them on the client |
Is there a reason foe this? |
Ideally, the user would be able to disable both |
Relevant: ipfs/kubo#5325 |
We've merged this change in go-ipfs. |
@achingbrain do you have any bandwidth to pick this up and restore interop? |
Adjusts file sizes accordingly. refs #427 License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
* fix: ls files sizes for compat with go-ipfs 0.4.19 Adjusts file sizes accordingly. refs #427 License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai> * fix: end test after stream is complete License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
This was fixed by ipfs-inactive/js-ipfs-unixfs-exporter#20 and will be released in js-ipfs 0.35 |
Currently, the size returned by
ls
is the size of the DAG under the link (usinglink.Size
). However, most users will expectipfs ls /some/directory
to list the sizes of the files (as returned byipfs cat /some/directory/file | wc -b
).Proposal:
filesize
field.I highly doubt this will break any existing projects. Really, it's more likely to fix hidden bugs than it is to cause them.
See: ipfs/kubo#5906 (comment)
The text was updated successfully, but these errors were encountered: