Loadfs and Unloadfs: Weird case sensibility management
#2

I had this problem in 0.2X as well.

It's because loadfs doesn't care about case-sensitivity when loading a file, however in memory it's loaded as whatever you typed after "loadfs".

It's a bigger problem than what you showed, loadfs will load the script as many times as typed with different capitalisation.

For example:
loadfs filterscript
loadfs Filterscript
loadfs FIlterscript
loadfs FILterscript
loadfs FILTerscript

Now you have 5 scripts loaded, all the same script from filterscript.amx.
Depending on the script, it can cause the server/script to malfunction because of the duplicate items in each loaded script.



unloadfs will now be able to unload all of them, but no other case variations of them.

For example:
unloadfs filterscript
unloadfs Filterscript
unloadfs FIlterscript
unloadfs FILterscript
unloadfs FILTerscript

Those will all work, however any other case variations will not.


For a slightly better example, I quickly checked this on a SA-MP 0.3R4 Windows server with the "base.amx" filterscript that comes with the server.
I can assure you I only had "base.amx", all lowercase, in my filterscripts directory.
Quote:

Console input: loadfs base
[10:06:24] --Base FS loaded. "base", the original, is loaded

[10:06:24] Filterscript 'base.amx' loaded.
Console input: loadfs Base
[10:06:26] --Base FS loaded. "Base", from "base", is loaded

[10:06:26] Filterscript 'Base.amx' loaded.
Console input: loadfs BAse
[10:06:29] --Base FS loaded. "BAse", from "base", is loaded

[10:06:29] Filterscript 'BAse.amx' loaded.
Console input: loadfs BASe
[10:06:31] --Base FS loaded. "BASe", from "base", is loaded

[10:06:31] Filterscript 'BASe.amx' loaded.
Console input: loadfs BASE
[10:06:33] --Base FS loaded. "BASE", from "base", is loaded

[10:06:33] Filterscript 'BASE.amx' loaded.
Console input: unloadfs BaSe
[10:06:46] Filter script 'BaSe.amx' unload failed. "BaSe" was not loaded previously, despite the others with the same name but different case
Console input: unloadfs BASE
[10:06:49] Filterscript 'BASE.amx' unloaded. "BASE" was loaded previously
Console input: unloadfs BASe
[10:06:52] Filterscript 'BASe.amx' unloaded. "BASe" was loaded previously
Console input: unloadfs BAse
[10:06:54] Filterscript 'BAse.amx' unloaded. "BAse" was loaded previously
Console input: unloadfs Base
[10:06:57] Filterscript 'Base.amx' unloaded. "Base" was loaded previously
Console input: unloadfs base
[10:06:59] Filterscript 'base.amx' unloaded. "base" was loaded previously
Reply


Messages In This Thread
Loadfs and Unloadfs: Weird case sensibility management - by Zamaroht - 29.12.2009, 21:19
Re: Loadfs and Unloadfs: Weird case sensibility management - by ev0lution - 29.12.2009, 22:22

Forum Jump:


Users browsing this thread: 1 Guest(s)