I was working on some scripts when I discovered that I couldn’t get file.Read to work clientside, it would only ever return nil while it would work fine when running file.Read server side reading server side files.
To test this I was using file.Read to look for wire_version.txt which is present in both my client and the server in the data folder.
local test = file.Read(“wire_version.txt”)
if test == nil then print(“File not found”)
else print(test) end
When I run it in a lua file in \garrysmod\lua\autorun\server
it prints the correct wire_version (gm13-401-gf291c42) which is expected
Where as when I place the lua file in \garrysmod\lua\autorun\client
it prints File not found to the clients console.
I then later discovered that even Adv dupe 2 was throwing errors when trying to load/save dupes from the client however adv dupe 1 worked perfectly since it saved the files on the server. However whenever a client attempts to upload a folder from their client to the server it again throws errors since it’s calling file.Read to read the dupe.
I have no idea what is causing this and would really appreciate any ideas to why this might be happening.
Many thanks, Jophes.