---
title: "(-- api-linter: core::0131::synonyms=disabled aip.dev/not-precedent: StatFile is a custom method on a singleton resource, not a standard Get method. The \"stat\" verb follows Unix convention and is appropriate for metadata retrieval. --) Gets metadata about a file or directory (similar to Unix stat). If the path is a symbolic link, returns metadata about the target file (symlink is followed)."
method: GET
path: "/v1/{name}/filesystem:statFile"
tags: ["FilesystemService"]
---

# (-- api-linter: core::0131::synonyms=disabled aip.dev/not-precedent: StatFile is a custom method on a singleton resource, not a standard Get method. The "stat" verb follows Unix convention and is appropriate for metadata retrieval. --) Gets metadata about a file or directory (similar to Unix stat). If the path is a symbolic link, returns metadata about the target file (symlink is followed).

`GET /v1/{name}/filesystem:statFile`

## Request

- Base URL: `https://docs.h2o.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.h2o.ai/v1/{name}/filesystem:statFile`
- Auth: none declared
- TypeScript: <https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto/docs/v1/:name/filesystem:statFile/get.ts> (a function with typed inputs; its response is checked against the schema)

Authorization: Only the creator of the parent SandboxEngine is allowed to call this method.

## Path parameters

- `name` string, required

## Query parameters

- `path` string, required

## Response `200`

A successful response.

- V1StatFileResponse: Response from getting file metadata.
  - `fileInfo` V1FileInfo: FileInfo contains metadata about a file or directory.
    - `path` string: Output only. The absolute path of the file or directory.
    - `size` string, int64: Output only. The size of the file in bytes. For directories, this is typically 0 or the size of the directory metadata.
    - `type` 'FILE_TYPE_UNSPECIFIED' | 'FILE_TYPE_REGULAR' | 'FILE_TYPE_DIRECTORY' | 'FILE_TYPE_SYMLINK': FileType indicates the type of filesystem entry. - FILE_TYPE_UNSPECIFIED: The file type is not specified. - FILE_TYPE_REGULAR: A regular file. - FILE_TYPE_DIRECTORY: A directory. - FILE_TYPE_SYMLINK: A symbolic link.
    - `modifyTime` string, date-time: Output only. The last modification time of the file or directory (mtime).
    - `mode` string: Output only. Unix file mode and permission bits in octal notation. The format follows standard Unix permissions represented as a string. Examples: "0644" (rw-r--r--), "0755" (rwxr-xr-x), "0777" (rwxrwxrwx).

## Other responses

- `default`: An unexpected error response.

---

[API](https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto.md) - [All operations](https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto/revisions/297cfadc1d39?raw)
