> For the complete documentation index, see [llms.txt](https://docs.aios.foundation/aios-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aios.foundation/aios-docs/aios-kernel/storage/sto_write.md).

# 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}"
