about summary refs log tree commit diff stats
path: root/src/luasocket
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-03-05 18:04:35 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-03-05 18:04:35 -0800
commit52ae23784b5474298c6ada6252f5a785fc5e8c19 (patch)
tree519e3b3812f4543161b5c4ed9674a7e2b59bb785 /src/luasocket
parent2d6b88204bca1787cbcc08bbff4383e1980cd196 (diff)
downloadteliva-52ae23784b5474298c6ada6252f5a785fc5e8c19.tar.gz
new API for file operations
File operations now always return a channel (or nil on error or
permission denied).

When start_reading() from a filename, you can repeatedly :recv() from
the channel it returns.
When :recv() returns nil, you're at the end of the file. Stop.

When you start_writing() to a filename, you can repeatedly :send() to
the channel it returns.
When you're done writing, :close() the channel. Writes to the file won't
be externally visible until you do.

To make this work I'm now always starting up the scheduler, so I need to
fix sieve.tlv.

Transparently running the scheduler is an abstraction, and whenever I
create an abstraction I always worry about how it might fail. There's
a hopefully-clear error when you read past end of a file.
Diffstat (limited to 'src/luasocket')
0 files changed, 0 insertions, 0 deletions