This repository was archived by the owner on Mar 10, 2020. It is now read-only.
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
Make the size field of ls correspond to to the size of the file #427
Closed
Description
Currently, the size returned by ls
is the size of the DAG under the link (using link.Size
). However, most users will expect ipfs ls /some/directory
to list the sizes of the files (as returned by ipfs cat /some/directory/file | wc -b
).
Proposal:
- Return a 0 (-1?) size for directories. Directory sizes really don't make sense.
- Return the actual file size for files. That is, the size stored in the file's
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.