Onran aae642a13e
Streaming I/O and support of named pipes (#570)
* added streaming i/o for scripting, and a byteutil.get_size function

* added i/o stream class, also added named pipes support on lua side via ffi

* added constant file.named_pipes_prefix

* added buffered and yield modes for io_stream

* added new time function for work with UTC - utc_time, utc_offset, local_time

* docs updated

* constant pid moved to os.pid

* now gmtime_s and localtime_s used only in windows
2025-08-01 20:26:43 +03:00

17 lines
394 B
Lua

local io_stream = require "core:io_stream"
local lib = {
read = file.__read_descriptor,
write = file.__write_descriptor,
flush = file.__flush_descriptor,
is_alive = file.__has_descriptor,
close = file.__close_descriptor
}
return function(path, mode)
return io_stream.new(
file.__open_descriptor(path, mode),
mode:find('b') ~= nil,
lib
)
end