about the MFS LFN problem

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

about the MFS LFN problem

ソリューションへジャンプ
1,769件の閲覧回数
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,379件の閲覧回数
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,379件の閲覧回数
fukefeng
Contributor III

K70 device, MQX4.0

0 件の賞賛
返信
1,380件の閲覧回数
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,379件の閲覧回数
fukefeng
Contributor III

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

0 件の賞賛
返信
1,379件の閲覧回数
zhiyangzhang
Contributor III

You are welcome. Best Regards!

0 件の賞賛
返信
1,379件の閲覧回数
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,379件の閲覧回数
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 件の賞賛
返信