/* Reads some data and returns the number of bytes read. The actual data (possibly an empty string) is pushed on the Lua stack.  */
static int File_read_chars(lua_State *L, FILE_T ft, size_t n)
/* Reads some data and returns the number of bytes read. The actual data (possibly an empty string) is pushed on the Lua stack.  */
static int File_read_chars(lua_State *L, FILE_T ft, size_t n)
{
        if (rlen > n) rlen = n;
        nri = file_read(buff, (unsigned int)rlen, ft);
        if (nri < 1) break;
        nr = (size_t) nri;
        luaL_addlstring(&b, buff, nr);
        n -= nr;
    } while (n > 0 && nr == rlen);
    luaL_pushresult(&b);
    return (n == 0 || lua_rawlen(L, -1) > 0);
}