void CCopyContactsAO::UpdateTimeStamp() { RFs fs; fs.Connect(); TBuf<256> cdbFileName; // Contact db file name if (iDatabase->FindContactFile(cdbFileName)) { TTime cdbTime; fs.Modified(cdbFileName, cdbTime); TDateTime janNineteenSeventy (1970,EJanuary,0,00,00,00,000000); TTime timejan(janNineteenSeventy); TTimeIntervalMicroSeconds interval = cdbTime.MicroSecondsFrom(timejan); TInt64 cdbVal; cdbVal = interval.Int64()/1000; TBuf<256> timestamp; timestamp.Num(cdbVal); iAppUi.AddTimeStampToFileL(×tamp); } fs.Close(); }
void CenrepSwiOOMTest::UpgradeInstallL(TBool aIsSetup) { if(aIsSetup) { // Install file InstallL(ETrue); InstallL(EFalse); RFs fs; User::LeaveIfError(fs.Connect()); CleanupClosePushL(fs); CFileMan* fm = CFileMan::NewL(fs); CleanupStack::PushL(fm); // Get modification time TTime time; TBuf<50> fileName(KInstallFile); fs.Modified(fileName, time); // Copy upgrade file into install dir & Reset read-only bit User::LeaveIfError(fm->Copy(KInstallOnlyUpgradeFile, KInstallFile)); User::LeaveIfError(fm->Attribs(KInstallFile,0,KEntryAttReadOnly,TTime(0))); // Modify timestamp to cause upgrade ModifyTimeStampL(fs,&fileName, time); CleanupStack::PopAndDestroy(2); // fs and fm } else { iSwiWatcher->HandleSWIEventL(ESASwisInstall | ESASwisStatusSuccess); } }