You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use case:
open a file with readonly,then lseek to the end with offset 0
there will return a error( ENOSPC 28 "No space left on device")
so i can't get the file size with this.
TestFile:13,107,200 Byte
Code:
static off_t fat_seek(FAR struct file filep, off_t offset, int whence)
---------1164
if ((ff->ff_oflags & O_WROK) != 0)
{
/ Extend the cluster chain (fat_extendchain
* will follow the existing chain or add new
* clusters as needed.
*/
cluster = fat_extendchain(fs, cluster);
}
else
{
/* Otherwise we can only follow the existing chain */
cluster = fat_getcluster(fs, cluster);
}
---------1178
when i debug i found that fat_getcluster(fs, cluster) will retrun the "0x0fffffff" that means FAT cluster end.
but in fat_seek ,there is no end deal,so there will be a error.
The break way is less than clustersize,in the loop, position Just coincidentally equal to clustersize,so it continue find next cluster chan.
---------1142
if (position < clustersize)
{
break;
}
---------1145
Solution:
add FAT end deal or make break condition wiht "position <= clustersize"
The text was updated successfully, but these errors were encountered:
Run all .c and .h files in last PR through tools/nxstyle and fix all complaints.
Author: macman88 <jjlange91@gmail.com>
LPC17xx serial updates (#29)
* Save CONFIG_ARCH_BOARD_CUSTOM when running 'make savedefconfig'
* Don't compile up_earlyserialinit if USE_EARLYSERIALINIT is not defined
* Added support for RS485 direction control on LPC17xx UART1
* First pass at fractional baud rate divider on LPC17xx/40xx
* Added support for fractional divider to console UART
Run all .c and .h files in last PR through tools/nxstyle and fix all complaints.
Author: macman88 <jjlange91@gmail.com>
LPC17xx serial updates (#29)
* Save CONFIG_ARCH_BOARD_CUSTOM when running 'make savedefconfig'
* Don't compile up_earlyserialinit if USE_EARLYSERIALINIT is not defined
* Added support for RS485 direction control on LPC17xx UART1
* First pass at fractional baud rate divider on LPC17xx/40xx
* Added support for fractional divider to console UART
Use case:
open a file with readonly,then lseek to the end with offset 0
there will return a error( ENOSPC 28 "No space left on device")
so i can't get the file size with this.
TestFile:13,107,200 Byte
Code:
---------1178
when i debug i found that fat_getcluster(fs, cluster) will retrun the "0x0fffffff" that means FAT cluster end.
but in fat_seek ,there is no end deal,so there will be a error.
The break way is less than clustersize,in the loop, position Just coincidentally equal to clustersize,so it continue find next cluster chan.
---------1142
---------1145
Solution:
add FAT end deal or make break condition wiht "position <= clustersize"
The text was updated successfully, but these errors were encountered: