using IO_IOCTL_FIND_NEXT_FILE

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

using IO_IOCTL_FIND_NEXT_FILE

跳至解决方案
1,820 次查看
Wanderer
Contributor II

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

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,303 次查看
PetrM
Senior Contributor I

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

 

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,303 次查看
oliviachristyva
Contributor III

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

0 项奖励
回复
1,304 次查看
PetrM
Senior Contributor I

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

 

0 项奖励
回复
1,303 次查看
Wanderer
Contributor II

Thanks PetrM,

 

Defining MFS_SEARCH_DATA struct as STATIC worked.  


Cheers, gj

0 项奖励
回复