Skip to content
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
@Stebalien

Description

@Stebalien

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:

  1. Return a 0 (-1?) size for directories. Directory sizes really don't make sense.
  2. 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.

See: ipfs/kubo#5906 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions