Read next directory entry into the cache Assumes file is correctly positioned
| 1562 | // Read next directory entry into the cache |
| 1563 | // Assumes file is correctly positioned |
| 1564 | dir_t* SdBaseFile::readDirCache() { |
| 1565 | uint8_t i; |
| 1566 | // error if not directory |
| 1567 | if (!isDir()) return 0; |
| 1568 | |
| 1569 | // index of entry in cache |
| 1570 | i = (curPosition_ >> 5) & 0xF; |
| 1571 | |
| 1572 | // use read to locate and cache block |
| 1573 | if (read() < 0) return 0; |
| 1574 | |
| 1575 | // advance to next entry |
| 1576 | curPosition_ += 31; |
| 1577 | |
| 1578 | // return pointer to entry |
| 1579 | return vol_->cache()->dir + i; |
| 1580 | } |
| 1581 | |
| 1582 | /** |
| 1583 | * Remove a file. |