This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
TSK_SMILEY's profile picture

Error event

Started by TSK_SMILEY, 16 April 2017 - 02:52 PM
TSK_SMILEY #1
Posted 16 April 2017 - 04:52 PM
so i am truing to make a simple export programs but i cant find out what event to use in my if statement

args = {...}
local file= args[1]
shell.run("copy ", file, "/disk/")
--here i want some kind of if statement to avoud false information
print("Exported to disk")
FuzzyLitchi #2
Posted 17 April 2017 - 04:06 PM
You should use the fs API, probably the fs.exists() function.


if fs.exists("/disk/file") then
  print("Success")
end
Edited on 17 April 2017 - 02:09 PM