# sto\_create\_directory

```python
def sto_create_directory(self, dir_name: str, dir_path: str, collection_name: str = None) -> str
```

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

Description: Create a directory based on either dir\_name or dir\_path

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

Parameters:

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

Returns:

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