SdFat icon indicating copy to clipboard operation
SdFat copied to clipboard

Read file from the end

Open Pt32 opened this issue 3 years ago • 1 comments

Hi,

I want to read a file from the end with a buffer[24]. I use seek() to go back in the file.

That's work perfectly.

But it's aproximatly 10x longer than using read() to read the file from the top.

Is there an another way to be more efficient ? And took the same time that read() function. Do I need to recode the read() function?

Thanks,

Pt32 avatar Aug 02 '22 21:08 Pt32

No, FAT file systems and SD cards are not designed to read from the end. You could improve the speed by using a very large buffer.

greiman avatar Aug 03 '22 12:08 greiman