一 创建
// Create private folder
RProcess process;
TFileName path;
path.Copy(process.FileName().Left(1));
if (path.Compare(_L("c")) == 0 || path.Compare(_L("C")) == 0)
CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveC);
else if (path.Compare(_L("e")) == 0 || path.Compare(_L("E")) == 0)
CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveE);
二 读取私有路径
TFileName CuninstallAppUi::AppPrivatePath()
{
RFs fsSession;
User::LeaveIfError(fsSession.Connect());
CleanupClosePushL(fsSession);
TFileName appfullname, fn;
appfullname = Application()->AppFullName();
fsSession.PrivatePath(fn);
#ifdef __WINS__ // See macro definition in DBMS.mmp
fn.Insert(0, KCDrive);
#else // In device use the application fullname directly.
TParse parse;
parse.Set(appfullname, NULL, NULL);
fn.Insert(0, parse.Drive());
#endif
BaflUtils::EnsurePathExistsL(fsSession, fn);
CleanupStack::PopAndDestroy(&fsSession);
return fn;
}