How do I read the file count on a mounted USB flash drive?

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

How do I read the file count on a mounted USB flash drive?

2,791 次查看
ashbc1
Contributor III

I am running MQX4.2 and have built USB and MFS into my project.   A USB drive is interfaced OK and MFS installed.   I can read using 'read' a file so I am confident MFS is OK.   Is there a short way of reading the count of files in the present directory?

标签 (2)
3 回复数

2,605 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Ashley:

I would suggest you try IO_IOCTL_FIND_FIRST_FILE,IO_IOCTL_FIND_NEXT_FILE commands to search on the disk.  There is an example to list all files and sub directories in a directory. You can count the files in a specified directory.

pastedImage_1.png

Please refer to the MQX_MFS_User_Guide.pdf, section 3.8.1.8 for more details.

Regards

Daniel

2,605 次查看
ashbc1
Contributor III

Thanks.  That's what I did in the end.   I was hoping there was a simple command as this is rather long winded just to get a file count.  Works though

0 项奖励
回复

2,605 次查看
danielchen
NXP TechSupport
NXP TechSupport

I agree with you it is long, but MFS does not provide a simple command as your expected.

0 项奖励
回复