int ff_pwrite(int fd, const byte *buffer, int sz)
{
    FIL *f = &fd_pool[fd].f;
    FRESULT ret;
    unsigned int rsz;
    if (fd_pool[fd].used == 0)
        return -1;
    ret = f_write(f, buffer, sz, &rsz);
    if (ret != FR_OK)
        return -1;
    return rsz;
}
int ff_pwrite(int fd, const byte *buffer, int sz)
{
    FIL *f = &fd_pool[fd].f;
    FRESULT ret;
    unsigned int rsz;
    if (fd_pool[fd].used == 0)
        return -1;
    ret = f_write(f, buffer, sz, &rsz);
    if (ret != FR_OK)
        return -1;
    return rsz;
}