Listing files in a directory
api.GetApplicationFiles(appID, path) returns the entries of a directory as a []squarecloud.FileInfo. An empty path lists the application root.
| Field | Type | Description |
|---|---|---|
Type | string | "file" or "directory" |
Name | string | Entry name |
Size | int | Size in bytes — always 0 for directories |
LastModified | int64 | Last modification in Unix milliseconds |
Reading a file
api.ReadApplicationFile(appID, path) returns a squarecloud.FileContent with the file bytes.
The API returns the content as a Node.js-style Buffer object (
{"type": "Buffer", "data": [...]}). The SDK decodes it for you — content.Data is a plain []byte (the ByteArray type), ready to use.Creating or overwriting a file
api.PutApplicationFile(appID, path, content) writes content at path, creating the file if it does not exist or overwriting it if it does. It returns a squarecloud.FileWritten.
The content is sent to the API as a UTF-8 string — binary file uploads are not supported yet. To ship binary files, use a commit instead.
Moving or renaming a file
api.MoveApplicationFile(appID, path, to) moves or renames a file.

