Seeed_Arduino_FS icon indicating copy to clipboard operation
Seeed_Arduino_FS copied to clipboard

ListFiles code's .open("/") does not work on root, no dir or file seen

Open RaphTronic opened this issue 1 year ago • 0 comments

The ListFiles example in this library does not show any file in the root directory despite a handful of .txt and .pdf files being present.

The output is simply: 13:28:36.861 -> Initializing SD card... 13:28:36.900 -> initialization done. 13:28:36.900 -> - - - - - - - - - - - - - - - - - - - - - - - - - 13:28:36.900 -> done!

Same issue with both the SD_Test and ReadWrite examples. Their tests (create a file, delete, etc) all work except for their listDir and printDirectory subs that, like in the ListFiles example, do not output anything (no file or dir detected).

The problem happens on: File root = DEV.open("/"); Which always returns 'empty' (false). So openNextFile does not work, no files are returned. Instead of "/" for root I also tried "", "//", "0", "0:", "0:/", "0://", "root", etc. Unsuccesfully.

However, if a TESTDIR directory exists, DEV.open("/TESTDIR") works and returns true, and openNextFile properly returns files.

Looks like a library issue with .open("/")

--> How can the list of files in root be retrieved on a WIO terminal ?

Setup: WIO Terminal, FAT32 16GB card, Arduino IDE 2.2.1, Seeed SAMD Board library 1.8.5, Windows 10

Note: a similar issue is posted on seeed's forum as well: https://forum.seeedstudio.com/t/on-wio-terminal-i-am-unable-to-open-the-root-directory-on-an-sd-card/275254/3 .

RaphTronic avatar Mar 17 '24 19:03 RaphTronic