Modding Tools > Lucas' Simpsons Hit & Run Mod Launcher > Hacks > Mod Requirable Hacks > Custom Files > Custom Lua Functions > General Functions > ComparePaths


Compares two paths with options to ignore different casing and different slashes.


ComparePaths( <path1>, <path2>, [<case_insensitive>, <slash_insensitive>] )
  • path1: The first path.
  • path2: The second path.
  • case_insensitive: Whether or not the comparison is case insensitive.
    • Optional, defaults to true.
  • slash_insensitive: Whether or not the comparison is slash insensitive.
    • Optional, defaults to true.


-- Result is true
local Result = ComparePaths("art\\cars\\famil_v.p3d", "art/cars/famil_v.p3d")

-- Result is false, the capitalization is different.
local Result = ComparePaths("ART\\CARS\\FAMIL_V.p3d", "art/cars/famil_v.p3d", false)

-- Result is false, the slashes are different.
local Result = ComparePaths("ART\\CARS\\FAMIL_V.p3d", "ART/CARS/FAMIL_V.p3d", true, false)


No additional notes.

Version History


Fixed an issue where this function was always case sensitive and always slash sensitive.

Unknown Version

Added this function.

Donut Team © 2024 · v4.0