///////////////////////////////////////////////////////////////////////////
//    Copyright (C) 2014 Wizardry and Steamworks - License: GNU GPLv3    //
///////////////////////////////////////////////////////////////////////////
// Remove all descriptors k and all data associated with descriptor k 
// from head to tail and return the number of bytes deleted (excluding
// the length of the descriptor k).
integer wasPrimFSDelete(string k, integer head, integer tail) {
    integer b;
    do {
        string d = wasGetLinkDescription(tail);
        if(llStringLength(d) == 0) jump continue;
        b += llStringLength(wasKeyValueGet(k, d));
        wasSetLinkDescription(tail, 
            wasKeyValueDelete(
                k,
                d
            )
        );
        // GC
        d = "";
@continue;
    } while(--tail>=head);
    return b;
}