> For the complete documentation index, see [llms.txt](https://fecality-api.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fecality-api.gitbook.io/docs/documentation/namespaces/filesystem.md).

# Filesystem

filesystem namespace

### Functions <a href="#functions" id="functions"></a>

#### read <a href="#read" id="read"></a>

fs.read("some\_file.txt")

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ |
| ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| path                                                                                     | string                                                                                  | path to file                                                                               |

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ |
| ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------- |
| data                                                                                 | string                                                                                  |

#### read\_stream <a href="#read_stream" id="read_stream"></a>

fs.read\_stream("some\_file.txt")

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ |
| ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| path                                                                                     | string                                                                                  | path to file                                                                               |

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ |
| ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------- |
| data                                                                                 | table of char                                                                           |

#### write <a href="#write" id="write"></a>

fs.write("some\_file.txt", "data")

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ |
| ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| path                                                                                     | string                                                                                  | path to file                                                                               |
| data                                                                                     | string                                                                                  | data to write to file                                                                      |

​

#### write\_stream <a href="#write_stream" id="write_stream"></a>

fs.write\_stream("some\_file.txt", {"a", "b", "c"})

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ |
| ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| path                                                                                     | string                                                                                  | path to file                                                                               |
| data                                                                                     | table of char                                                                           | data in bytes to write to file                                                             |

#### remove <a href="#remove" id="remove"></a>

fs.remove("some\_file.txt")

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ |
| ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| path                                                                                     | string                                                                                  | path to file                                                                               |

#### exists <a href="#exists" id="exists"></a>

fs.exists("some\_file.txt")

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ |
| ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| path                                                                                     | string                                                                                  | path to file or directory                                                                  |

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ |
| ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------- |
| true if file exists                                                                  | boolean                                                                                 |

#### is\_file <a href="#is_file" id="is_file"></a>

fs.is\_file("some\_file.txt")

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ |
| ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| path                                                                                     | string                                                                                  | path to file                                                                               |

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ |
| ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------- |
| true if path leads to a file                                                         | boolean                                                                                 |

#### is\_dir <a href="#is_dir" id="is_dir"></a>

fs.is\_dir("some\_file.txt")

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ |
| ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| path                                                                                     | string                                                                                  | path to directory                                                                          |

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ |
| ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------- |
| true if path leads to a directory                                                    | boolean                                                                                 |

#### create\_dir <a href="#create_dir" id="create_dir"></a>

fs.create\_dir("folder/some\_directory")

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/namespaces/filesystem)​ |
| ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| path                                                                                     | string                                                                                  | path to directory                                                                          |
