This function returns a file path with capitalization fixed to match the existing file on the hard drive. It will also convert backslashes to forward slashes. The specified file must exist.
Parameter | Description |
---|---|
path | the file path to use |
Returns the file path with corrected capitalization.
local path = CurrentDir()
-- Convert to lowercase
path = path:Lower()
Print("Lowercase path: ")
Print(path)
Print("")
-- Correct case
path = CasedPath(path)
Print("Corrected path: ")
Print(path)