-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Truncate with littlefs #7091
Comments
Hi @OscarGarciaF, you will need a int LittleFileSystem::file_truncate(fs_file_t file, off_t length)
{
lfs_file_t *f = (lfs_file_t *)file;
_mutex.lock();
LFS_INFO("file_truncate(%p)", file);
int err = lfs_file_truncate(&_lfs, f, length);
LFS_INFO("file_truncate -> %d", lfs_toerror(err));
_mutex.unlock();
return lfs_toerror(err);
} Sorry about all the hoops you've been having to jump through, truncate was added very recently and you've probably noticed it's not integrated into Mbed OS yet. Files in littlefs limited by a 32-bit file size. So ~4GB. (related: #7010) |
Please do not merge |
Internal Jira reference: https://jira.arm.com/browse/IOTSTOR-445 |
How may i truncate with the littlefs?
I see that lfs.cpp has the method defined but LittleFileSystem.cpp does not have a file_truncate method
how may i accomplish this?
Also may i know what's the maximum size of a file in the littlefs?
@geky
The text was updated successfully, but these errors were encountered: