about the MFS LFN problem

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

about the MFS LFN problem

跳至解决方案
1,483 次查看
fukefeng
Contributor III

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

标签 (1)
标记 (3)
0 项奖励
回复
1 解答
1,093 次查看
zhiyangzhang
Contributor III

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.

在原帖中查看解决方案

0 项奖励
回复
6 回复数
1,093 次查看
fukefeng
Contributor III

K70 device, MQX4.0

0 项奖励
回复
1,094 次查看
zhiyangzhang
Contributor III

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.

0 项奖励
回复
1,093 次查看
fukefeng
Contributor III

Thank you, I used the mathod you which you provided,now it work well.

0 项奖励
回复
1,093 次查看
zhiyangzhang
Contributor III

You are welcome. Best Regards!

0 项奖励
回复
1,093 次查看
fukefeng
Contributor III

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;

}


0 项奖励
回复
1,093 次查看
fukefeng
Contributor III

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!

0 项奖励
回复