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

# FileSystem

### CreateDir

`MTools.FileSystem.CreateDir(path);`

| Name | Type         | Description       |
| ---- | ------------ | ----------------- |
| path | **`string`** | Path to directory |

**Allows you to create a directory.**\ <mark style="color:blue;">**The Original Way:**</mark><mark style="color:blue;">**&#x20;**</mark><mark style="color:blue;"><mark style="color:orange;">**Counter-Strike Global Offensive**<mark style="color:orange;"></mark>

\ <mark style="color:green;">**Example usage:**</mark>

```lua
local create = MTools.FileSystem.CreateDir("TEST");
print(create);
-- If successful, it will return "The directory was successfully created.";
-- If performed poorly, it will return "An error occurred while creating the directory.";
```

### GetGameDirectory

`MTools.FileSystem.GetGameDirectory();`

| Name | Type | Description |
| ---- | ---- | ----------- |
| -    | -    | -           |

**Allows you to get a normal path to the game directory.**

\ <mark style="color:green;">**Example usage:**</mark>

```lua
print(MTools.FileSystem.GetGameDirectory());
-- Return: c:\program files (x86)\steam\steamapps\common\Counter-Strike Global Offensive\
```

### DeleteFile

`MTools.FileSystem:DeleteFile(path, file, auto);`

| Name | Type          | Description                                                                                      |
| ---- | ------------- | ------------------------------------------------------------------------------------------------ |
| path | **`string`**  | Path to directory                                                                                |
| file | **`string`**  | File name                                                                                        |
| auto | **`boolean`** | Automatically get the path. If true, then only the directory name must be inserted into the path |

**Allows you to delete a file by name.**

\ <mark style="color:green;">**Example usage:**</mark>

```lua
MTools.FileSystem:DeleteFile("nl\\", "Image.png", true);
-- Deletes the 'Image.png' file in the 'nl' directory.
```

### **ReadFolder**

`MTools.FileSystem:ReadFolder(path, auto);`

| Name | Type          | Description                                                                                      |
| ---- | ------------- | ------------------------------------------------------------------------------------------------ |
| path | **`string`**  | Path to directory                                                                                |
| auto | **`boolean`** | Automatically get the path. If true, then only the directory name must be inserted into the path |

**Allows you to get all Files and Directories by path.**

\ <mark style="color:green;">**Example usage:**</mark>

```lua
for Key, Value in pairs(MTools.FileSystem:ReadFolder("MonixLITE", true)) do
    print(Key, " ", Value);
end
-- Sends to the console all the files in the 'MonixLITE' folder in the 'Counter-Strike Global Offensive' directory.

-- [neverlose] 1 Fonts
-- [neverlose] 2 IMG
```
