We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ce89e3 commit b6b8763Copy full SHA for b6b8763
libraries/FS/src/vfs_api.cpp
@@ -434,17 +434,18 @@ bool VFSFileImpl::seek(uint32_t pos, SeekMode mode)
434
if (res < 0) {
435
// an error occurred
436
log_d("FILE SEEK ERROR OCCURED");
437
- return 1; //return error -> for seek its all above 0
+ return 0; //return error -> for lseek its all above 0
438
}
439
- return 0; //return success -> for fseek its 0
+ return 1; //return success -> for fseek its 0
440
441
442
size_t VFSFileImpl::position() const
443
{
444
if(_isDirectory || !_f) {
445
return 0;
446
447
- return ftell(_f);
+ return lseek(fileno(_f), 0, SEEK_CUR);
448
+ //return ftell(_f); // old implementation
449
450
451
size_t VFSFileImpl::size() const
0 commit comments