# sto\_write

```python
def sto_write(file_name: str, file_path: str, content: str, collection_name: str = None) -> str
```

[Source code](https://github.com/agiresearch/AIOS/blob/main/aios/storage/filesystem/lsfs.py)

Description:  Write specific content into a file

Parameters:

* file\_name (str): Name of the file
* file\_path (str): Full path to the file (optional)
* content (str): Content to write
* collection\_name (str): Name of the collection/agent (optional)

Returns:

* Success message (str): "Content has been written to file: {file\_path}"
* Lock timeout message (str): "Timeout waiting for lock on {file\_path}"
* Error message (str): "Error writing to file: {error\_message}"


---

# 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://docs.aios.foundation/aios-docs/aios-kernel/storage/sto_write.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.
