removed require to define available, tell, seek in ioLib

This commit is contained in:
Onran 2026-06-22 14:47:58 +09:00
parent 21019e6737
commit 82da7e907d
5 changed files with 20 additions and 45 deletions

View file

@ -98,10 +98,6 @@ function lib.tell(descriptor)
return positions[descriptor]
end
function lib.flush(descriptor)
requireDescriptor(descriptor)
end
function lib.available(descriptor)
requireDescriptor(descriptor)

View file

@ -60,18 +60,6 @@ function lib.write(fd, bytearray)
end
end
function lib.seek(fd, mode, offset)
error("cannot seek the named pipe")
end
function lib.tell(fd)
error("cannot tell the named pipe")
end
function lib.flush(fd)
-- no flush on unix
end
function lib.available(fd)
if fd == nil or fd < 0 then return 0 end

View file

@ -97,14 +97,6 @@ function lib.write(handle, bytearray)
end
end
function lib.seek(handle, mode, offset)
error("cannot seek the named pipe")
end
function lib.tell(handle)
error("cannot tell the named pipe")
end
function lib.flush(handle)
C.FlushFileBuffers(handle)
end

View file

@ -32,18 +32,6 @@ function lib.write(descriptor, data)
sockets[descriptor]:send(data)
end
function lib.seek(descriptor, mode, offset)
error("cannot seek socket")
end
function lib.tell(descriptor)
error("cannot tell socket")
end
function lib.flush(descriptor)
requireDescriptor(descriptor)
end
function lib.available(descriptor)
requireDescriptor(descriptor)