After thinking about recent comments about reading CSV files, and trying a few experiments,
I noticed odd behavior when using gets in nonblocking mode on files that did not end with a newline.
non-blocking mode doesn't make much sense on a file. On a socket or
command pipe, non-blocking is useful because if the sender decides not
to send any data, you would otherwise wait infinitely long. A file is
always ready. My guess is that you actually want to do something else.
Are you reading from a pipe to the logger, or from a disk file which is
in parallel updated by the logger?
Where do you see nonblocking mode in tcllib csv?
I don't see any 'fconfigure' commands in the module, only
while !eof
if gets < 0 continue
loops... (tcllib 1.20).
I *think* your best bet in this case would be to set up an fileevent
handler for the serial line, and read the data event-based as they come
in. Note however that you would need some indication when no more input
is to be expected from the serial line.
| I am reading from a file now, but might end up reading data over USB
| serial from a Teensy LC or 3.2 microcontroller.
I *think* your best bet in this case would be to set up an fileevent
handler for the serial line, and read the data event-based as they come
in. Note however that you would need some indication when no more input
is to be expected from the serial line.
R'
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 485 |
Nodes: | 16 (2 / 14) |
Uptime: | 131:31:31 |
Calls: | 9,655 |
Calls today: | 3 |
Files: | 13,707 |
Messages: | 6,166,553 |