Garry's Mod Wiki

util.RelativePathToFull_Menu

  string util.RelativePathToFull_Menu( string filePath, string mountPath = "MOD" )

Description

Converts the relative path of a given file to the full path on disk.
You can use util.FullPathToRelative_Menu to convert the full path back to the relative path.

Arguments

1 string filePath
The relative path of a file, for example: addons/[Name].gma
2 string mountPath = "MOD"
The path to look for the files and directories in. See this list for a list of valid paths.

Returns

1 string fullpath
The full path to the file.

Example

Searches for a .gma file in your addons folder and converts the path to a full path.

local files, _ = file.Find( "addons/*.gma", "GAME" ) local file = "addons/" .. files[1] -- gets the first file and converts it into the relative path. print( util.RelativePathToFull_Menu( file ) ) -- prints the full path of the GMA file.
Output:
[Steam folder]\common\garrysmod\garrysmod\addons\[Name].gma