Home Contents | # Introduction | Rawio | Core4 Lua Event System

## DESCRIPTION

The Rawio Module contains a host of functions for working with files, serial ports, network sockets and other devices.

Data is not buffered in application space, as stdio would do, but instead buffering is left to the operating system.

- Common functions
  - Opening and closing files: rawio.open, rawio:close, rawio.attach, rawio:detach, rawio.dup
  - Data transfer: rawio:read, rawio:write, rawio:slurp
  - Behaviour: rawio:blocking
  - Error Handling: rawio:clearError, rawio:lastError
  - Information: rawio:fd, rawio.stat, rawio:stat
  - Line buffering: rawio:canReadLine, rawio:line, rawio:lines
- Network sockets
  - Connection handling: rawio.socket, rawio:bind, rawio:listen, rawio:accept, rawio:connect, rawio:shutdown
  - Behaviour: rawio:getsockopt, rawio:setsockopt
  - Data transfer: rawio:read, rawio:write, rawio:recvfrom, rawio:sendto
  - Network interfaces: rawio.ifconfig, rawio.interfaces
- Serial ports (TTY)
  - Configuration: rawio:setupComm
  - Port control: rawio:drain, rawio:flush, rawio:start, rawio:stop
  - Information: rawio:device, rawio:name, rawio:rxcnt, rawio:txcnt
  - Control signals: rawio:cts, rawio:dcd, rawio:dsr, rawio:dtr, rawio:rng, rawio:rts, rawio:sendBreak, rawio:setDtr, rawio:setRts