Buffered file-like stream helpers used by OpenOS and SecureOS I/O wrappers.
- Repository:
opencomputers - System:
openos - Type:
library
OpenComputers/src\main\resources\assets\opencomputers\loot\openos\lib\buffer.lua
local buffer = require("buffer")- Description: Flush pending output when needed, mark the wrapper closed, and then close the underlying stream.
buffer.close()- Description: Write the current buffered output block to the underlying stream immediately.
buffer.flush()- Description: Return an iterator that repeatedly reads records from the buffered stream.
- Parameters:
...
buffer.lines(nil)- Description: Wrap a raw stream handle with buffering, read timeout state, and read or write mode flags.
- Parameters:
modestream
buffer.new(nil, nil)- Description: Read data using Lua-style format arguments or line mode when no format is supplied.
- Parameters:
...
buffer.read(nil)- Description: Read one line from the internal read buffer, optionally preserving the line ending.
- Parameters:
choptimeout
buffer.readLine(nil, nil)- Description: Configure buffering mode as
no,full, orline, and optionally set the buffer size. - Parameters:
modesize
buffer.setvbuf(nil, nil)- Description: Write strings or numbers to the stream, honoring the active buffering mode.
- Parameters:
...
buffer.write(nil)- Instances returned by
buffer.newwrap a lower-level stream and add line buffering, formatted reads, timeout handling, and file-like helper methods.