# sto\_create\_file

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

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

Description: Create a file based on either file\_name or file\_path

* If the file\_path is provided, it will create the file directly at the location of the file\_path
* Else If the file\_name is provided, the file will be created at the path of os.path.join(self.root\_dir, file\_name)

Parameters:

* file\_name (str): Name of the file to create
* file\_path (str): Full path where to create the file
* collection\_name (str): Name of the collection/agent (optional)

Returns:

* Success message (str): "File has been created successfully at: {file\_path}"
* Exists message (str): "File already exists at: {file\_path}"
* Error message (str): "Error creating 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_create_file.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.
