I use the MFS on the usb storage device,if you just use the short file name,you can find the file names soon,and if you want find the long file names,it takes too long times.eg.there are about 100 or 200 files in the current. maybe i use the api in wrong way
Solved! Go to Solution.
Maybe you can refer to this https://community.freescale.com/thread/309151. I just encountered the same problem and resolved it in the end. Some efficient method should be used to satisfy your demand. The difference is that I read from SD card which does not matter.
K70 device, MQX4.0
Maybe you can refer to this https://community.freescale.com/thread/309151. I just encountered the same problem and resolved it in the end. Some efficient method should be used to satisfy your demand. The difference is that I read from SD card which does not matter.
Thank you, I used the mathod you which you provided,now it work well.
You are welcome. Best Regards!
if((search_data.ATTRIBUTE & MFS_ATTR_DIR_NAME) == MFS_ATTR_DIR_NAME) {
error_code = ioctl(HS_USBFS_HANDLE, IO_IOCTL_FIND_NEXT_FILE, (uint_32_ptr) &search_data);
continue;
}
I use the api in this way:
error_code = ioctl(HS_USBFS_HANDLE, IO_IOCTL_FIND_FIRST_FILE, (uint_32_ptr) &search);
while (error_code == MFS_NO_ERROR) {
lfn_struct.PATHNAME = search_data.NAME;
error_code = ioctl(HS_USBFS_HANDLE, IO_IOCTL_GET_LFN, (uint_32_ptr) &lfn_struct);
if((search_data.ATTRIBUTE & MFS_ATTR_DIR_NAME) == MFS_ATTR_DIR_NAME) continue;
if(0 != strcmp(".\0", (char *)&search_data.NAME))
if(error_code == MFS_NO_ERROR)
strcpy(ListPtr2[ListPtrNum2], lfn);
else
strcpy(ListPtr2[ListPtrNum2], search_data.NAME);
error_code = ioctl(HS_USBFS_HANDLE, IO_IOCTL_FIND_NEXT_FILE, (uint_32_ptr) &search_data);
}
thanks for answer me!