Jump to content




fs table does not contain definition for exsists function


  • You cannot reply to this topic
4 replies to this topic

#1 TheMadHatter

  • Members
  • 3 posts

Posted 12 September 2016 - 01:21 PM

I started this script below in which I wanted to alter file content. When I put in my first check if the file exists, it threw out of the blue the "a attempt to call nill" error. I am clueless what the problem seems to be.

I modified the script to gather more information and look it prints the exists function, but later when I try to access it directly it is nill again?

I rebooted the CC computer in the hope it is a corrupted table, but with no success. (Also tried restarting minecraft)
(Vanilla CraftOS 1.7)
Posted Image

The script....
arguments = {...}
print(#arguments)
blrup = {}
references = {}
if arguments ~= nil and #arguments > 0 then
for k,v in pairs(fs) do
  print(" ",k, "-", v)
  fs[k]=v
  blrup[k] = v
  if references[v] then
   error("reference found twice" , k)
  end
  references[v] = true
end

if( arguments[1] and string.lower(arguments[1]) == "register" and arguments[2] and fs["exsists"](arguments[2])) then
  print("Service registered - %s", arguments[2])
elseif arguments[1] and string.lower(arguments[1]) == "register" then
  printError("Please use Service register [PATH]")
  print("Is fs nil? ", fs == nil)
  print("Is fs.exsists nil? ", fs.exsists == nil and fs["exsists"] == nil and blrup["exsists"] == nil)
  print(fs.exsists("/test"))
end
end

I hope you guys can spot any issues?

Edited by TheMadHatter, 12 September 2016 - 03:12 PM.


#2 Dog

  • Members
  • 1,179 posts
  • LocationEarth orbit

Posted 12 September 2016 - 03:38 PM

In several places in your script you have fs.exsists (note the extra 's') instead of fs.exists.

#3 TheMadHatter

  • Members
  • 3 posts

Posted 12 September 2016 - 04:04 PM

Hahaha damn it typos get me quite a lot. I am crap without a propper auto complete ^^

Thanks man :)

#4 Anavrins

  • Members
  • 775 posts

Posted 12 September 2016 - 04:13 PM

When stuff like this happens, you should always consider typing error...
In fact, in your screenshot, you can clearly see that "exist" exists...
Posted Image

#5 TheMadHatter

  • Members
  • 3 posts

Posted 12 September 2016 - 04:15 PM

View PostAnavrins, on 12 September 2016 - 04:13 PM, said:

When stuff like this happens, you should always consider typing error...
In fact, in your screenshot, you can clearly see that "exist" exists...
Posted Image

I read it a couple of times and tought I typed it correctly... don't know why :P





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users