External drives can already be used to store the calendar database file. This means that all clients may access, modify and create calendar files on removable media in the same way as on non-removable media.
A calendar file can be opened on any writable drive. Note that if the file is opened on a removable drive and that drive is removed, the operation leaves with an error.
This error can also happen when trying to access file attachments on removed media.
When this error occurs, the user should close the CCalSession and re-open it once the media has been replaced. The Calendar indexes must then be restored ('rolled back') to their previous state.
It is recommended that when using a calendar file on removable media, the user should watch for when the media is removed or replaced using the RFs::NotifyChange() API.
If media is removed during an operation a KErrNotReady again occurs, and in the following cases a rollback is effected:
Function | What has happened if it leaves with KErrNotReady | Does a rollback occur? |
---|---|---|
CCalSession::CreateCalFileL(const TDesC& aFileName) | File not created | N/A |
CCalSession::OpenL(const TDesC& aFileName) | File not created | N/A |
CCalSession::DeleteCalFileL(const TDesC& aFileName) | File not created | N/A |
CCalEntryView::StoreL(const RPointerArray <CCalEntry>& aCalEntryList, TInt& aNumSuccessfulEntry) | aNumSuccessfulEntry entries were successfully added before the leave. | Last store rolled back in RAM after disk write fails. |
CCalEntryView::UpdateL(const RPointerArray <CCalEntry>& aCalEntryList, TInt& aNumSuccessfulEntry) | aNumSuccessfulEntry entries were successfully added before the leave. | Last store rolled back in RAM after disk write fails. |
CCalEntryView::DeleteL(const CDesC8Array& aUidList) | Some of the UIDs were not deleted (how many is unknown). | Last UID delete rolled back in RAM. |
CCalEntryView::DeleteL(const CCalEntry& aCalEntry) | Nothing deleted | Deleted entries in RAM are rolled back. |
CCalInstanceView::DeleteL(CCalInstance* aInstance, CalCommon::TRecurrenceRange aWhichInstances) | Nothing deleted | Deleted entries in RAM are rolled back. |
CCalCategoryManager::AddCategoryL(const CCalCategory& aCategory) | Category not added to file | No rollback in RAM. |
CCalCategoryManager::DeleteCategoryL(const CCalCategory& aCategory, MCalProgressCallBack& aProgressCallBack) | Category not added to file | No rollback in RAM. |