Overview
Thestat() method retrieves detailed metadata about a resource, including size, mode, timestamps, and whether it’s a directory.
This method is useful for checking resource existence and getting file attributes without reading content.
Method Signature
Parameters
string
required
The Viking URI of the resource to inspect
Response
string
Resource name (filename or directory name)
integer
Size in bytes (0 for directories)
integer
File mode/permissions (Unix-style)
boolean
Whether this is a directory
string
Full Viking URI of the resource
number
Last modification timestamp
number
Creation timestamp
Examples
Check if Resource Exists
Before Reading Content
Response Example
Error Responses
Resource Not Found
Use Cases
- Existence Check - Verify resource exists before operations
- Size Inspection - Check file size before reading
- Directory Detection - Determine if URI points to file or directory
- Metadata Queries - Get timestamps for change tracking
