[BUG?] Workshop-based add-ons can't open files for reading

I’ve had issues with uploading an add-on to the Workshop. I’ve made a previous post about this, but I don’t think I made things clear. This might be my own misunderstanding of Workshop add-ons; if that’s the case, I’d like some clarification.

The add-on appears to work perfectly fine if I put it directly into the garrysmodbeta folder. However, it doesn’t if I upload then download it from the Workshop. It errors out related to the following code:



	local list = file.Find("mprime_themes/*.lua",LUA_PATH)
	for _,fil in pairs(list) do
		print(fil,"mprime_themes/"..fil);
		local f=file.Open("mprime_themes/"..fil,'rb',LUA_PATH)
		if f ~= nil then
			RunString('function THEME_FUNCTION()
return {
'..f:ReadString(f:Size())..'
};
end')
			--RunString('function a()
return {
'..file.Read("autorun/client/mprime_themes/"..fil,LUA_PATH)..'
};
end')
			themes[string.sub(fil,0,string.find(fil,".lua")-1)]=THEME_FUNCTION();
			Msg('MPHUD: mounted \''..string.sub(fil,0,string.find(fil,".lua")-1)..'\' successfully
')
			f:Close()
		end
	end

The folders exist and the filenames are read perfectly fine, but the “if f ~= nil” line doesn’t appear to ever be true when using this from Workshop. I’m not completely sure why, but the reasons could be a lack of file access permissions.

It has kind of been a month, and no response - this needs to be read. Bump.

well if you are doing a text file then do it in the data folder. That works for me.

They’re .lua files.