diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-03-05 18:04:35 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-03-05 18:04:35 -0800 |
commit | 52ae23784b5474298c6ada6252f5a785fc5e8c19 (patch) | |
tree | 519e3b3812f4543161b5c4ed9674a7e2b59bb785 /gemini.tlv | |
parent | 2d6b88204bca1787cbcc08bbff4383e1980cd196 (diff) | |
download | teliva-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 'gemini.tlv')
0 files changed, 0 insertions, 0 deletions