2

I have a File variable called dir and i'm building a simple file explorer for my device. Is there a way to get a reference to dir's parent directory?

3
  • Doesn't dir.name() return dir's name with the path?
    – ocrdu
    Dec 14 '20 at 19:18
  • Unfortunately it only returns the name Dec 14 '20 at 19:43
  • 1
    Then probably the only way is to keep a list of the directories you traversed while going to that file, or while building the directory structure from root. There may be an other way, but I don't know the SD library well enough.
    – ocrdu
    Dec 14 '20 at 20:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.