///////////////////////////////////////////////////////////////////////////
//    Copyright (C) 2014 Wizardry and Steamworks - License: GNU GPLv3    //
///////////////////////////////////////////////////////////////////////////
// Reads the filesystem on the partition between head and tail and returns
// the data associated with the file descriptor k.
string wasPrimFSRead(string k, integer head, integer tail) {
    string output = "";
    do {
        string d = wasGetLinkDescription(tail);
        if(llStringLength(d) == 0) jump continue;
        if(llListFindList(wasKeyValueGetKeys(d), [ k ]) == -1)
            jump continue;
        output += wasKeyValueGet(k, d);
@continue;
        // GC
        d = "";
    } while(--tail>=head);
    return output;
}