# I/O

### Function Signatures

{% code overflow="wrap" %}

```go
// File open modes
const OpenMode = {
    app: 1,
    read: 8,
    write: 16,
    trunc: 32,
}

// Open a file with specified file path and open mode.
const open = (filePath: String, openMode: Number = OpenMode.read) => Pointer

// Close a file with given file handle.
const close = (fileHandle: Pointer) => None

// Read from a file with given file handle.
const read = (fileHandle: Pointer) => String

// Write content to a file with given file handle.
const write = (fileHandle: Pointer, content: String) => None

// Read input from standard input.
const input = () => String

// Read content from a file with specified file path. Automatically handles closing the file.
const readf = (filePath: String) => String

// Write content to a file with specified file path, truncating existing content. Automatically handles closing the file.
const writef = (filePath: String, content: String) => String

// Append content to a file with specified file path. Automatically handles closing the file.
const appendf = (filePath: String, content: String) => String

```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dibs.gitbook.io/vortex-docs/standard-modules/i-o.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
