ipfs / ipfs/kubo

Add flag to list cumulative size of directories

Open
#5,804 4 comments 1 reaction 0 assignees View on GitHub
kind/enhancement topic/ls API
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

#### Version information:
0.4.18

#### Type:
Enhancement

#### Description:
Currently, the web view of directories lists the cumulative size, that is the on-disk size of directories. However, the `ipfs file ls` and the `ipfs ls` commands do not - the former always returns `0` (for the current directory) and the latter returns the size of the directory node only (the size of the list of links).

My personal stance is that there should be consistency between the web interface and the command line and at least one of the `ls` commands should return the cumulative size. However, @schomatis suggested in #4580 that a command line flag might be added to `ipfs file ls` and `ipfs ls` so that it returns the cumulative size for directories. I would suggest this would be in addition to the currently returned `Size`, similar to the way `ipfs files stat` returns both `Size` and `CumulativeSize`.

Alternately, he suggested adding an `ipfs du` command returning the 'on disk' size of items. But given that the current set of commands is already kind of a mess, I would strongly suggest not adding another command before giving it considerate thought.

Note that, to the best of my knowledge, `ipfs file ls` is to be deprecated over `ipfs ls`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.