Get filesystem path info
client.instances.stat(stringid, InstanceStatParams { path_, follow_links } query, RequestOptionsoptions?): PathInfo { exists, error, is_dir, 5 more }
/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.
Parameters
id: string
Returns
Get filesystem path info
import Hypeman from '@onkernel/hypeman';
const client = new Hypeman({
apiKey: 'My API Key',
});
const pathInfo = await client.instances.stat('id', { path: 'path' });
console.log(pathInfo.exists);
{
"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
}