Skip to content
This repository was archived by the owner on Oct 5, 2023. It is now read-only.

Stat call missing in UnixFS #78

Closed
dokterbob opened this issue Mar 20, 2020 · 2 comments
Closed

Stat call missing in UnixFS #78

dokterbob opened this issue Mar 20, 2020 · 2 comments

Comments

@dokterbob
Copy link

The equivalent of https://docs.ipfs.io/reference/api/cli/#ipfs-files-stat, returns stuff like:

{
"Hash":"QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ",
"Size":0,
"CumulativeSize":443417,
"Blocks":1,
"Type":"directory"
}

and

{
"Hash":"Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u",
"Size":443230,
"CumulativeSize":443362,
"Blocks":2,
"Type":"file"
}
@dokterbob
Copy link
Author

I suppse we return:

type FileStat struct {
    Cid cid.Cid
    Blocks int
    Size int
    CumulativeSize int
    Type FileType
}

based on ObjectStat, ref: https://github.com/ipfs/interface-go-ipfs-core and https://godoc.org/github.com/ipfs/interface-go-ipfs-core#ObjectStat

Suggested call signature:
func (api *UnixfsAPI) Stat(ctx context.Context, p path.Path) (*iface.ObjectStat, error)

@Stebalien
Copy link
Member

Closing in favor of ipfs/interface-go-ipfs-core#58. There needs to be an interface decision here first.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants