How to move to parent directory with SdFat library


I am currently trying to build a system which needs to read file in SD card.

I found that there might be two ways to change directory to parent.

First one is using SdFat::chdir, as follows. void loop() and other functions are not included.

#include <SdFat.h>
SdFat sd;
const uint8_t SD_CS_PIN = 53;
void setup()
if (!sd.begin(SD_CS_PIN)) sd.initErrorHalt();
void loop()

I tried using chdir as follows.


But, this effort did not work.

The other way is using SdBaseFile::openParent as follows. I have modified SdBaseFile.h to change openParent to Public in order to to this.

SdBaseFile file;

But, this effort did not also work.

Do you have idea how to move to parent directory?