# getResourceFiles (Shared)

> Lists the files a resource declares with `<file>` in its `meta.xml`, with patterns already expanded, in alphabetical order.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Resources and modules
- **URL**: https://wiki.mymp.gg/en/getResourceFiles

## Syntax

```lua
table|false getResourceFiles(resource|string resource)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `resource` | `resource\|string` | The resource, or its name. |

## Returns

A table of the paths inside the resource, or `false` if the resource does not exist.

## Example

```lua
for _, path in ipairs(getResourceFiles(getThisResource())) do
    outputDebugString(path)
end
```

### Note

On the server, the list is only built when the resource starts; a stopped resource returns an empty table.

## See also

- [getResourceInfo (Server)](https://wiki.mymp.gg/en/getResourceInfo.md): Reads an attribute of the <info> tag in a resource's meta.xml, such as author or version.
- [getResourceName (Shared)](https://wiki.mymp.gg/en/getResourceName.md): Returns a resource's name.
- [getResourceExportedFunctions (Shared)](https://wiki.mymp.gg/en/getResourceExportedFunctions.md): Lists the names of the functions a resource exports in its meta.xml, on any side.
