Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]


How to use file server sessions

The Rfs class represents a session with the file server. The following code demonstrates the use of the session path and shows how to connect and disconnect to and from the file server.

_LIT(KSession,"Session path for fsSession is %S\n"); 
RFs fsSession;
CleanupClosePushL(fsSession);
User::LeaveIfError(fsSession.Connect()); 
TFileName path;
User::LeaveIfError(fsSession.SessionPath(path));
console->Printf(KSession,&path); 
... 
... 
fsSession.Close();
CleanupStack::PopAndDestroy();

Use CleanupClosePushL() and CleanupStack::PopAndDestroy() so that fsSession is still closed if any of the User::LeaveIfError() functions leave.

See also How to use CleanupClosePushL().

[Top]


Notes