# pathListDir (Shared)

> Lists what a folder holds.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Files
- **URL**: https://wiki.mymp.gg/en/pathListDir

## Syntax

```lua
table|false pathListDir(string path)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `path` | `string` | A path inside the calling resource, or `@resource/path` for another resource's file. |

## Returns

The names in alphabetical order, folders ending in `/`, or `false` if the folder does not exist or could not be read.

A path may not contain `..`, `\` or `:`, nor start with `/`. Another resource's files can only be read; an invalid path logs a warning and the function returns `false`.

## Example

```lua
for _, name in ipairs(pathListDir("maps") or {}) do
    if name:sub(-1) ~= "/" then
        print("map file: " .. name)
    end
end
```

## See also

- [pathIsDirectory (Shared)](https://wiki.mymp.gg/en/pathIsDirectory.md): Tells whether a path is a folder.
- [pathIsFile (Shared)](https://wiki.mymp.gg/en/pathIsFile.md): Tells whether a path is a file. It does the same as fileExists.
