Page 1 of 1

[Answered] Using opendir() on a FATFS VFS file system.

Posted: Sat May 20, 2017 10:17 pm
by kolban
I have create a FATFS VFS file system and mounted it at "/spiflash". When I attempt to use opendir("/spiflash") I get a failure (errno=2) however if I attempt to open a directory within my mounted file system (eg. opendir("/spiflash/myDir")) I get no error.

So my question becomes one of "Can I use opendir() on the root directory of a mounted FATFS/VFS file system?"

Re: Using opendir() on a FATFS VFS file system.

Posted: Sat May 20, 2017 10:29 pm
by ESP_igrr
You may possibly have to call opendir("/spiflash/"). The fact that the form without the trailing slash doesn't work is likely a bug in VFS. Thanks for reporting.

Re: Using opendir() on a FATFS VFS file system.

Posted: Mon May 22, 2017 12:09 am
by kolban
Thank you sir. Using opendir("/spiflash/") worked as you suggested.