Update bug or what? file.Read reads wrong file

After todays fix update. ULib starts read users and groups from addons/ulib/data/users.txt instead of data/ulib/users.txt



file.Read( ULib.UCL_USERS, "DATA" )


That’s very odd. Reading from the “DATA” path should only ever access ./garrysmod/data. Are you sure there is no code reading from “GAME”?

http://s10.postimg.org/92v7zmrwp/Untitled.png

Could you paste the text output when you run “path” in your server’s console?

You mean print ULib.UCL_USERS ?

Just path

–file.Read( ULib.UCL_USERS, “DATA” )

> print(ULib.UCL_USERS)…
ulib/users.txt

I just meant that I wanted you to type “path” (nothing else) in to the console… although, that’s very strange output.

ULib.UCL_USERS is equal to “data/ulib/users.txt” in the default installation of ULX. file.Read( ULib.UCL_USERS, “DATA” ) should be failing completely. Have you modified it at all?

Seems like I have outdated ULib. I don’t even have functions: ULib.fileRead.
But anyway. It worked before update and broked only today :frowning:

I can’t reproduce your issue even when using “ulib/users.txt”. Can you just run path in your console and show me the output?

http://scrnsht.me/u/1tb/raw

Can you tell me what version of ULX this is?

2.50

[editline]23rd February 2016[/editline]

This is ridiculous, but even
print(file.Read(“data/ulib/users.txt”, “GAME”))
prints addons/ulib/data/ulib/users.txt

[editline]24th February 2016[/editline]

Just for clear experiment.
These are 2 IDENTICAL COPIES of the same server.
Left wasn’t updated, right was.

http://s21.postimg.org/xgw7rn647/Untitled1.png

[editline]24th February 2016[/editline]

My god.

http://s23.postimg.org/pf19ncpsr/Untitled1.png

[editline]24th February 2016[/editline]

Look at this:



--- TEMP fix for garry's broken API (Hopefully he fixes this soon, still broken as of official GM13 release)

local oldExists = file.Exists
function file.Exists( path, option )
	if option == "DATA" then
		option = "GAME"
		path = "data/" .. path
	end
	return oldExists( path, option )
end


ULib’s temporary fix from 2.50. F&ck it.

That “fix” was removed in March 2013.

You really should update your ULX and ULib:

After looking in github for 2 seconds it appears your running a version from 2013. Just use the version on workshop

I’m actually updated it on my beta server, update something on old is over dangerous. :slight_smile: