Read files from a folder
From Forum Nokia Wiki
The GetFilesFromFolderL() method illustrates how to use GetDir() function in RFs to read all files from a specified folder. (*File_list)[i] gives you the TEntry of the selected file, so you can also use its functions to determine more information of the file before adding it to your array list.
void GetFilesFromFolderL(TDesC& aFolder,CDesCArray* aArray) { CDir* File_list(NULL); if(KErrNone == CCoeEnv::Static()->FsSession().GetDir(aFolder, KEntryAttMaskSupported, EDirsFirst, File_list)) { if(File_list && aRegisterer) { File_list->Sort(ESortByName); for(TInt i=0; i < File_list->Count(); i++) { if((*File_list)[i].IsSystem() || (*File_list)[i].IsHidden() || (*File_list)[i].IsDir()) { // ignore System & Hidden Files & folders } else { aArray->AppendL((*File_list)[i].iName); } } } delete File_list; File_list = NULL; } }
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem in SMS Application | deepu28 | Mobile Java General | 3 | 2008-04-14 18:16 |
| Problems with Series 60 Emulator | comando_c | Mobile Java Tools & SDKs | 2 | 2003-10-14 04:46 |
| read file from PC | karanala | General Symbian C++ | 14 | 2007-03-22 09:06 |
| 安装Carbide.vs 3.0.1时找不到S60 SDK和VS2005? | fn_wyq | Symbian | 12 | 2008-08-31 10:45 |
| mms folders | elena_santander | General Symbian C++ | 0 | 2003-05-06 10:39 |
