Scanning folders & subfolders in Symbian devices
Article Metadata
Article
Created: bharatuppal
(23 Jul 2007)
Updated: mayur_24
(29 Aug 2012)
Last edited: hamishwillee
(03 Sep 2012)
Location: f32file.h
Link against: efsrv.lib
TBuf<256> defaultImagesPath(_L("c:\\data\\images\\"));
CDir* presentFolder = NULL;
TFileName filteredImages( defaultImagesPath );
// valid Directory in the file system tree
// this version will only work with UI apps as we are using the CEikonEnv
CDirScan* scanner = CDirScan::NewLC(iEikonEnv->FsSession());
scanner->SetScanDataL(filteredImages, KEntryAttNormal, ESortByDate,CDirScan::EScanDownTree);
scanner->NextL(presentFolder);
while (presentFolder)
{
for(TInt index(0); index < presentFolder->Count() ;index++)
{
TEntry presentEntry = (*presentFolder)[index];
if( !presentEntry.IsDir() )
{
/* presentEntry points to content or file inside the folder
so do any operation */
}
}
delete presentFolder;
scanner->NextL(presentFolder);
}
CleanupStack::PopAndDestroy(1);//scanner


(no comments yet)