Skip to content
Get started

Get filesystem path info

get/instances/{id}/stat

Returns information about a path in the guest filesystem. Useful for checking if a path exists, its type, and permissions before performing file operations.

Path ParametersExpand Collapse
id: string
Query ParametersExpand Collapse
path: string

Path to stat in the guest filesystem

ReturnsExpand Collapse
PathInfo = object { exists, error, is_dir, 5 more }
exists: boolean

Whether the path exists

error: optional string

Error message if stat failed (e.g., permission denied). Only set when exists is false due to an error rather than the path not existing.

is_dir: optional boolean

True if this is a directory

is_file: optional boolean

True if this is a regular file

mode: optional number

File mode (Unix permissions)

size: optional number

File size in bytes

formatint64
Get filesystem path info
curl http://localhost:8080/instances/$ID/stat \
    -H "Authorization: Bearer $HYPEMAN_API_KEY"
{
  "exists": true,
  "error": "permission denied",
  "is_dir": false,
  "is_file": true,
  "is_symlink": false,
  "link_target": "/actual/target/path",
  "mode": 420,
  "size": 1024
}
Returns Examples
{
  "exists": true,
  "error": "permission denied",
  "is_dir": false,
  "is_file": true,
  "is_symlink": false,
  "link_target": "/actual/target/path",
  "mode": 420,
  "size": 1024
}