NAME
memchan - Create and manipulate memory channels
SYNOPSIS
package require TTccll package require mmeemmcchhaannmmeemmcchhaann ?-initial-size len?
DESCRIPTION
This manpage documents both the overall package and the command mmeemm-
cchhaann. The package itself provides a number of in-memory channels which
can utilized to+o capture stream-like information in a natural way instead of
using sseett and aappppeenndd to manipulate strings +o or to transfer data between interpreters, in the same thread or not. CCOOMMMMAANNDDmmeemmcchhaann ?-initial-size len?
creates a chunk-oriented in-memory channel and returns its han-
dle. If an initial size is specified the system will pre-allo-
cate len bytes of buffer space for the contents. This is no restriction on the ultimate size of the channel, it will always grow as much as is necessary to accomodate the data written into it. The channels created here can be transfered between interpreters in the same thread and between threads, but only as a whole. Itis not possible to use them to create a bi- or unidirectional
connection between two interpreters.Memory channels created by mmeemmcchhaann provide two read-only options which
can be queried via the standard ffccoonnffiigguurree command. These are-length
The value of this option is the number of bytes currently stored in the queried memory channel.-allocated
The value of this option is the number of bytes currently allo-
cated by the queried memory channel. This number is at least asbig as the value of -length.
As the channels generated by mmeemmcchhaann grow as necessary they are alwayswritable. This means that a writable ffiilleeeevveenntt-handler will fire con-
tinuously. The channels are also readable if they contain more than zero bytes andthe seek location is not and the end of the channel. Under these condi-
tions a readable ffiilleeeevveenntt-handler will fire continuously.
Note that writing to such a channel usually occurs at the end, thus supressing readable events. This also means that users have to take care to sseeeekk the channel to a location before the end before trying to read data back.SEE ALSO
fifo, fifo2, null KKEEYYWWOORRDDSSchannel, chunk, i/o, in-memory channel, memchan
COPYRIGHTCopyright (c) 1996-2003 Andreas Kupries
Memory channels 2.1 memchan(n)