Handbook
Glossary
handle-send-file ( bytes -- )
Vocabulary
tftp
Inputs
bytes
an
object
Outputs
None
Definition
USING:
assocs
combinators.short-circuit
io.encodings.binary
io.encodings.string
io.encodings.utf8
io.files
io.files.info
kernel
namespaces
sequences
splitting
;
IN:
tftp
:
handle-send-file
( bytes -- )
"\0"
split
harvest
first2
[
utf8
decode
]
bi@
over
{
[
file-exists?
]
[
file-info
directory?
not
]
}
1&&
[
"netascii"
sequence=
utf8
binary
?
0
read-file
boa
tftp-client
get
clients
get
set-at
0
handle-send-file-next
]
[
2drop
"File not found"
send-error
]
if
;