Beispiel #1
0
int LittleFileSystem::rename(const char *oldname, const char *newname)
{
    _mutex.lock();
    LFS_INFO("rename(\"%s\", \"%s\")", oldname, newname);
    int err = lfs_rename(&_lfs, oldname, newname);
    LFS_INFO("rename -> %d", lfs_toerror(err));
    _mutex.unlock();
    return lfs_toerror(err);
}
Beispiel #2
0
static int _rename(vfs_mount_t *mountp, const char *from_path, const char *to_path)
{
    littlefs_desc_t *fs = mountp->private_data;

    mutex_lock(&fs->lock);

    DEBUG("littlefs: rename: mountp=%p, from=%s, to=%s\n",
          (void *)mountp, from_path, to_path);

    int ret = lfs_rename(&fs->fs, from_path, to_path);
    mutex_unlock(&fs->lock);

    return littlefs_err_to_errno(ret);
}