PrintFile ?channel? ....
chan writeable $FH → result boolean yes/no
I require something to check if first argument is a channel and writeable.
* aotto1968 <aotto1968@t-online.de>
| hi,
| to implement a "puts" like command with:
| > PrintFile ?channel? ....
| I require something to check if first argument is a channel and writeable.
Check whether FH is known as a channel could be
if {$FH in [chan names]} {
# FH is a known channel
}
Check whether FH is Writeable:
chan pending output $FH
- returns -1 if FH was not opened for writing
Whether the channel is actually writeable (i.e. does not block on
'puts') depends on too many factors (buffersize, blocking mode etc), so
there is no generic answer.
R'
PrintFile stdin …
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 498 |
Nodes: | 16 (2 / 14) |
Uptime: | 00:21:47 |
Calls: | 9,820 |
Calls today: | 8 |
Files: | 13,757 |
Messages: | 6,190,173 |