mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 03:36:47 -04:00
fixed io.type
This commit is contained in:
parent
9886e646de
commit
a73ed001dd
@ -220,7 +220,7 @@ local file = {}
|
||||
function file:close()
|
||||
if self.handle then
|
||||
self:flush()
|
||||
self.stream:close()
|
||||
return self.stream:close()
|
||||
end
|
||||
end
|
||||
|
||||
@ -503,7 +503,7 @@ function file.new(fs, handle, mode, stream, nogc)
|
||||
|
||||
local metatable = {
|
||||
__index = file,
|
||||
__metatable = "private"
|
||||
__metatable = "file"
|
||||
}
|
||||
if not nogc then
|
||||
metatable.__gc = function(self)
|
||||
@ -561,9 +561,8 @@ end
|
||||
|
||||
function driver.fs.type(object)
|
||||
if type(object) == "table" then
|
||||
local mt = getmetatable(object)
|
||||
if mt and mt.__index == file then
|
||||
if f.handle then
|
||||
if getmetatable(object) == "file" then
|
||||
if object.handle then
|
||||
return "file"
|
||||
else
|
||||
return "closed file"
|
||||
|
Loading…
x
Reference in New Issue
Block a user