file.Exists() nil on server?

The error:

[ERROR] addons/test/lua/autorun/server/test.lua:8: attempt to call field 'Exists' (a nil value)
  1. func - addons/test/lua/autorun/server/test.lua:8
   2. unknown - lua/includes/modules/net.lua:31

Line 8 of test.lua:

8   if not file.Exists("testfolder","DATA") then
9	file.CreateDir("testfolder")
10  end

Arent all file library functions supposed to be shared?

you’ve probably done something like

local file = "some/path/file.lua"

Why would defining a local var somewhere make file.Exists nil?

I’m not saying that’s exactly what you’ve done, all I’m saying is you’ve probably overwritten the file library somewhere globally or in the same file you are trying to do this.

OHHHHHHHHHHHHhhhhhhhhhhhh now I see what you mean. Problem solved :smiley: