From 83f34b430d00573d25b41fc6959d31bf03a308fa Mon Sep 17 00:00:00 2001 From: "Wilma456 (Jakob0815)" Date: Fri, 28 Jul 2017 15:18:14 +0200 Subject: [PATCH] Make io.open() return Error If fs.open() failed, it will return nil and a a error message like "No such file" or "Out of space". This PR make, that io.open() returned this error too. --- src/main/resources/assets/computercraft/lua/rom/apis/io.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/computercraft/lua/rom/apis/io.lua b/src/main/resources/assets/computercraft/lua/rom/apis/io.lua index 2d503fbf0..d93ef9fdf 100644 --- a/src/main/resources/assets/computercraft/lua/rom/apis/io.lua +++ b/src/main/resources/assets/computercraft/lua/rom/apis/io.lua @@ -63,9 +63,9 @@ end function open( _sPath, _sMode ) local sMode = _sMode or "r" - local file = fs.open( _sPath, sMode ) + local file, err = fs.open( _sPath, sMode ) if not file then - return nil + return nil, err end if sMode == "r"then