Vely logo install

Vely 15.2.0 released on Jan 18, 2023
Articles updated Jan 17, 2023


Issues with this documentation page? Report here.


Reads key/value pair from a FIFO list.


read-fifo <list> \
    key [ define ] <key> \
    value [ define ] <value>


read-fifo retrieves a key/value pair from the FIFO <list>, storing them into <key> (in "key" clause) and <value> (in "value" clause), both of which can be created as strings with optional "define".

Once a key/value pair has been retrieved, the next use of read-fifo will obtain the following pair, in the same order they were put in. If the obtained <key> is NULL, the end of the list was reached. read-fifo starts with the first key/value pair put in, and moves forward from there, unless rewind-fifo is called, which positions back to the first pair.


In this example, a FIFO list is created, and two key/value pairs added. They are then retrieved in a loop and printed out (twice with rewind), and then the list is purged:

// Create a list
new-fifo mylist

// Add data to the list
write-fifo mylist key "key1" value "value1"
write-fifo mylist key "some2" value "other2"

while (1) {
    // Get data from the list
    read-fifo mylist key define k value define v

    // Check if no more data
    if (k == NULL) {

    @Obtained key <<p-out k>> with value <<p-out v>>

// Go through the list again, use rewind-fifo for that
rewind-fifo mylist

while (1) {
    read-fifo mylist key define k value define v
    if (k == NULL) {
    @Again obtained key <<p-out k>> with value <<p-out v>>

purge-fifo mylist

See also:

FIFO ( new-fifo   purge-fifo   read-fifo   rewind-fifo   write-fifo  )  SEE ALL (documentation)

Copyright (c) 2022 DaSoftver LLC. Vely is a trademark of Dasoftver LLC. The software and information herein are provided "AS IS" and without any warranties or guarantees of any kind. Vely elephant logo (c) 2022 DaSoftver LLC. This web page is licensed under CC-BY-SA-4.0.