Facepunch / garrysmod-issues

Garry's Mod issue tracker
142 stars 56 forks source link

file.Exists stopped working with the wildcards #5794

Closed Kotyarishka closed 6 months ago

Kotyarishka commented 6 months ago

Details

Server running on latest Linux x86-64 branch.

file.Exists stopped working with the wildcards after the March 13 update. Is it intended? If so, I'm pretty sure you broke all servers that using some sort of wrappers around MySQL modules (I believe there are other use-cases for that wildcard functionality).

Steps to reproduce

local isExistsWC = file.Exists("bin/gmsv_mysqloo_*.dll", "LUA") -- using wildcard
local isExistsNoWC = file.Exists("bin/gmsv_mysqloo_linux64.dll", "LUA") -- not using wildcard

print(isExistsWC) -- false, however file are here
print(isExistsNoWC) -- true, how it should be

This problem came up when server tried to load MySQLOO module to work with database, so there an example with that, obviously it will work with other files too.

robotboy655 commented 6 months ago

This is intentional, you were never meant to use wildcards with file.Exits, it was an undocumented bug.

In your case you want to use https://wiki.facepunch.com/gmod/util.IsBinaryModuleInstalled