/api/v0/files/stat

Display file status.

Arguments

  • arg [string]: Path to node to stat. Required: yes.

  • format [string]: Print statistics in given format. Allowed tokens: <hash> <size> <cumulsize> <type> <childs> and optional <mode> <mode-octal> <mtime> <mtime-secs> <mtime-nsecs>.Conflicts with other format options. Default: <hash> Size: <size> CumulativeSize: <cumulsize> ChildBlocks: <childs> Type: <type> Mode: <mode> (<mode-octal>) Mtime: <mtime>. Default: <hash> Size: <size> CumulativeSize: <cumulsize> ChildBlocks: <childs> Type: <type> Mode: <mode> (<mode-octal>) Mtime: <mtime>. Required: no.

  • hash [bool]: Print only hash. Implies '--format=<hash>'. Conflicts with other format options. Required: no.

  • size [bool]: Print only size. Implies '--format=<cumulsize>'. Conflicts with other format options. Required: no.

  • with-local [bool]: Compute the amount of the dag that is local, and if possible the total size. Required: no.

Response

On success, the call to this endpoint will return with 200 and the following body:

{
  "Blocks": "<int>",
  "CumulativeSize": "<uint64>",
  "Hash": "<string>",
  "Local": "<bool>",
  "Mode": "<uint32>",
  "Mtime": "<int64>",
  "MtimeNsecs": "<int>",
  "Size": "<uint64>",
  "SizeLocal": "<uint64>",
  "Type": "<string>",
  "WithLocality": "<bool>"
}

cURL Example

curl -X POST "http://127.0.0.1:5001/api/v0/files/stat?arg=<path>&format=<hash> Size: <size> CumulativeSize: <cumulsize> ChildBlocks: <childs> Type: <type> Mode: <mode> (<mode-octal>) Mtime: <mtime>&hash=<value>&size=<value>&with-local=<value>"

Last updated