I want to be able to scroll through available files on a disk without knowing the file names beforehand.
I am trying to modify the MFSUG example, "List all files and subdirectories in a directory", by creating subroutines for both IO_IOCTL_FIND_FIRST_FILE and IO_IOCTL_FIND_NEXT_FILE. For example, main() calls find_first_file() then subsequently calls find_next_file() each time I want to know the next file.
For some reason, MFS_SEARCH_DATA struct gets reset each time I call IO_IOCTL_FIND_NEXT_FILE so the required previous file is not saved.
Any ideas?
Thanks, gj
解決済! 解決策の投稿を見る。
Hello,
it does not create a list of any kind. The search data only contain information about one (last) file that matched your search criteria. You have to save the information needed yourself after each find-next-search.
PetrM
Hi guys,
I am working with the same thing. I reached till directory listing all the files but I dont know how to configure IO_IOCTL_FIND_FIRST_FILE and IO_IOCTL_FIND_NEXT_FILE to find the file I want from a USB stick .Please share your snippet to find the files and save it in a buffer.
Regards,
Olivia
Hello,
it does not create a list of any kind. The search data only contain information about one (last) file that matched your search criteria. You have to save the information needed yourself after each find-next-search.
PetrM
Thanks PetrM,
Defining MFS_SEARCH_DATA struct as STATIC worked.
Cheers, gj