How to enumerate all the files inside a directory using IFileSystem2 API | developer.brewmp.com How to enumerate all the files inside a directory using IFileSystem2 API | developer.brewmp.com

Developer

How to enumerate all the files inside a directory using IFileSystem2 API

Forums:

Hi all,

I am working on Brew MP with IFileSystem2 API and i need to enumerate all the files inside a folder/directory. According to the details i collected from previous discussions in this forum and the BREW MP API reference i came to know that i should use IFileSystem2_Open() with capability field set to FS_CAP_DIR. Its given that by doing this i will get the names of all the files inside the specified directory in the form of a NULL separated byte string. But here while im implementing this im finding difficulty. Not getting in while variable i will get that byte string. Can anybody help me out in this regard.?

following is the statement i used for enumeration..

int res;

res = IFileSystem2_Open(pFileSystem, "fs:/~0x0071C0F4/icons", FS_CAP_DIR, &pFilePort);

 

in this code the function is returning res = 257. Im not getting what that means?

 

please help me out in this regard.

 

thanking you in advance,

Sudarshan K S 

If you install the sample code there is an applet called UtilityPanel.  One of the things this
applet does is iterate through the file system to read all the .mif files checking them
for a certain kind of marking.  If you look in UtilityPanel_Model.c there is a function
called GetApplets that will read a directory and enumerate the files.
 
 
 

If you install the sample code there is an applet called UtilityPanel.  One of the things this
applet does is iterate through the file system to read all the .mif files checking them
for a certain kind of marking.  If you look in UtilityPanel_Model.c there is a function
called GetApplets that will read a directory and enumerate the files.
 
 
 

Hi jmiller2_,
Thanks for your reply. As you suggested i installed all the sample codes available with the SDK but i didn't find the one app which u suggested "utilityPanel". Can you do one more favor by providing any links for that app, if you have any..?? 
 
Thanks in advance,
Sudarshan K S 

Hi jmiller2_,
Thanks for your reply. As you suggested i installed all the sample codes available with the SDK but i didn't find the one app which u suggested "utilityPanel". Can you do one more favor by providing any links for that app, if you have any..?? 
 
Thanks in advance,
Sudarshan K S 

Hi,
We've recently changed the samplecode installer to also install utilities that also have source code. So now in the Samplecode folder are two subfolders called: samples and utilties. The UtilityPanel can be found in the utilities subfolder.
Thanks,Karina

Hi,
We've recently changed the samplecode installer to also install utilities that also have source code. So now in the Samplecode folder are two subfolders called: samples and utilties. The UtilityPanel can be found in the utilities subfolder.
Thanks,Karina

Hi Karina,
Thanks for your reply. Bit can u tell me with which SDK and Platform version i can get these Utility application samples..?
 
 
Thanks,
Sudarshan K S

Hi Karina,
Thanks for your reply. Bit can u tell me with which SDK and Platform version i can get these Utility application samples..?
 
 
Thanks,
Sudarshan K S

Hi Sudarshan,
Please try SDK rev 7.10.12. (utilities are in the SDK so you don't need to get another platform version for this)
 
Thanks,Karina

Hi Sudarshan,
Please try SDK rev 7.10.12. (utilities are in the SDK so you don't need to get another platform version for this)
 
Thanks,Karina

Hi all,
Thanks all for your valuable suggestions and tips. Now i'm able to enumerate the files in the folder using tips told by you people.
 
Thanking one and all,
Sudarshan K. S.

Hi all,
Thanks all for your valuable suggestions and tips. Now i'm able to enumerate the files in the folder using tips told by you people.
 
Thanking one and all,
Sudarshan K. S.