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,789件の閲覧回数
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,603件の閲覧回数
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,603件の閲覧回数
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,603件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

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

0 件の賞賛
返信