문제

I'm using Chan's FAT library that seems to provide a standard FAT filesystem API. The API doesn't seem to directly offer to list all the files in a given directory.

What is the standard way to list all files in a directory given access to a standard FAT API? Is there a special file (some "directory table"?) that I can access using f_read()?

도움이 되었습니까?

해결책

Have a look at f_opendir and f_readdir:

The f_readdir function reads directory entries in sequence. All items in the directory can be read by calling f_readdir function repeatedly. When all directory entries have been read and no item to read, the function returns a null string into f_name[] member without any error. When a null pointer is given to the FileInfo, the read index of the directory object will be rewinded.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top