MFS

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,040件の閲覧回数
netra
Contributor IV

I have Installed a device ram , under which I have installed a MFS named "s:"

Then I am uninstalling "s:".

I want to search all the files present in he device . so, I am opening ram using fopen & searching first file using ioctl , which is throwing error .

I am writing  a code to search a file from root directory.

mfs_ramdisk: is device driver , the directory is a:(only root directory is present no other directory is present)

error_code = ioctl(mfs_fd_ptr, IO_IOCTL_FIND_FIRST_FILE,(uint_32_ptr) &search);// I am getting error in this statement , it is failing and not displying any files searched 





mfs_fd_ptr = fopen("ramdisk:", NULL);

    if (mfs_fd_ptr == NULL)

    {

printf("Error opening the MFS device driver!");
return;

    }

   error_code = ioctl(mfs_fd_ptr, IO_IOCTL_FIND_FIRST_FILE,(uint_32_ptr) &search);

    while (error_code == MFS_NO_ERROR)

    {

error_code = ioctl(mfs_fd_ptr, IO_IOCTL_FIND_NEXT_FILE,(uint_32_ptr) &search_data);

    }

    fclose(mfs_fd_ptr);




Thanks in advance

ラベル(1)
タグ(3)
0 件の賞賛
返信
1 解決策
553件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi netra,

Why are you closing "s:"?

Have you reviewed and run the following example?

C:\Freescale\Freescale_MQX_4_0\mfs\examples\ramdisk\cw10

From the shell prompt, after you have formatted the drive, you can create a test file and the issue a "dir" shell command that will issue the IOCTL command to find the first file in current directory.

Here is my terminal output (note I used TWR-MEM card with MRAM):

shell> Demo start

Initialized Ram Disk to a:\

NOT A DOS DISK! You must format to continue.

Shell (build: Feb 15 2013)

Copyright (c) 2008 Freescale Semiconductor;

shell>

shell> format a:

Formating...

Done. Volume name is

Free disk space: 518144 bytes

shell>

shell> dir

shell>

shell> write test.txt 123

shell>

shell> dir

TEST.TXT         123 01-01-1980 00:04:26      A TEST.TXT

shell>

Similar topic that might also be of value:

Re: USB device with MFS ramdisk

Hope this helps.

Regards,

David

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
553件の閲覧回数
Monica
Senior Contributor III

Netra, is this helpful?

How is the project going?

Keep us posted please! :smileywink:

Regards!

0 件の賞賛
返信
554件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi netra,

Why are you closing "s:"?

Have you reviewed and run the following example?

C:\Freescale\Freescale_MQX_4_0\mfs\examples\ramdisk\cw10

From the shell prompt, after you have formatted the drive, you can create a test file and the issue a "dir" shell command that will issue the IOCTL command to find the first file in current directory.

Here is my terminal output (note I used TWR-MEM card with MRAM):

shell> Demo start

Initialized Ram Disk to a:\

NOT A DOS DISK! You must format to continue.

Shell (build: Feb 15 2013)

Copyright (c) 2008 Freescale Semiconductor;

shell>

shell> format a:

Formating...

Done. Volume name is

Free disk space: 518144 bytes

shell>

shell> dir

shell>

shell> write test.txt 123

shell>

shell> dir

TEST.TXT         123 01-01-1980 00:04:26      A TEST.TXT

shell>

Similar topic that might also be of value:

Re: USB device with MFS ramdisk

Hope this helps.

Regards,

David

0 件の賞賛
返信