Pages: [1]   Go Down
Author Topic: Read a specific offset from an fat16 SD card file?  (Read 893 times)
0 Members and 1 Guest are viewing this topic.
Nowhere at all
Offline Offline
Newbie
*
Karma: 0
Posts: 43
Patience, discipline
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would like to know if it would be possible, to say, to read from 0x53000 to 0x53422 of a file called "test.bin" that is in a fat16 formatted SD card.

If so, how?

BR
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13739
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


think you're looking for seek(position) - see libraries/SD/file.cpp of your arduno distri.

Code:
boolean File::seek(uint32_t pos) {
  return SD.file.seekSet(pos);
}
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Nowhere at all
Offline Offline
Newbie
*
Karma: 0
Posts: 43
Patience, discipline
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks robtillaart, will check it right now and post results!


BR
Logged

Nowhere at all
Offline Offline
Newbie
*
Karma: 0
Posts: 43
Patience, discipline
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Worked 100%

Thanks!!!
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13739
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Welcome,
BTW seek() can also be used for other ranges smiley-wink
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Pages: [1]   Go Up
Jump to: