views:

199

answers:

3

Do files or folders on S60 have some unique id value that can identify them?

I would like to have an id that can be later used to extract full path of a file or folder. Is this achievable?

If not, what would be the best way to keep track of files of interest? E.g. if I have a pdf reader, and I want to have a menu option to show all pdf files on the system - how do I prevent my application to search all over the whole system every time I chose this option? Can I search it once and easily monitor changes while my application is active?

Thank you.

+1  A: 

I can't quite see anything in the Symbian OS C++ API that would do exactly what you want.

Using RFs::NotifyChange() is probably your best bet.

QuickRecipesOnSymbianOS
RFs::NotifyChange() has a drawback that there is no much information on what change triggered the event. For instance, if I have a 3000 files under C:\\Documents\\, and a new one is created, there 3001 files, but I have to go through all of these, create a list of new files, and to compare a new list of 3001 files with the list of 3000 files just to find out what file has been created. That is an overkill!
Bojan Milankovic
CFileMan is your friend here but, yes, it's a lot of processing required for something that should be simple. Feel free to contact the Symbian Kernel and Hardware Services package owner about adding this to the platform.
QuickRecipesOnSymbianOS
I added the framework you're speculating about this summer. It's due to be in 10.1 I believe. The code is already released but disabled.Take a look at CFsNotify http://developer.symbian.org/xref/epl/xref/MCL/sf/os/kernelhwsrv/userlibandfileserver/fileserver/inc/f32notification.h#140
Dynite
A: 

Yes, index them at one point and use RFs::NotifyChange(). How would an ID help in identifying new files?

Teknolog
ID would help, as I could only keep track of IDs instead of full path. If there was an id, the operating system would keep track of moving a file from one location to another, I would not have to update my internal list of files.
Bojan Milankovic
I see your point. Having a UID for a file that is independent of pathname would be good, yes.
Teknolog
A: 

Symbian Timebox 10.1 (^3?) introduces a new file notification API, CFsNotify.

If tells you exactly what has changed and to which file/dir/drive.

http://developer.symbian.org/xref/epl/xref/MCL/sf/os/kernelhwsrv/userlibandfileserver/fileserver/inc/f32notification.h#140

It is similar to Microsoft's ReadDirectoryChangesW API.

Dynite