Loading and mounting a ﬁle system
We add ﬁle systems to the ﬁle server by calling the client method:
TInt RFs::AddFileSystem(const TDesC& aFileName) const
The argument aFileName speciﬁes the name of the FSY component to be loaded. ESTART normally does ﬁle-system loading during ﬁle server startup.
Once it has been successfully added, a ﬁle system can be mounted on a particular drive using the method:
TInt RFs::MountFileSystem(const TDesC& aFileSystemName, TInt aDrive) const
In this method, aFileSystemName is the object name of the ﬁle system and aDrive is the drive on which it is to be mounted.
The EKA1 version of the ﬁle server requires a nominated default ﬁle system, which must be called ELOCAL.FSY. The EKA2 version of the ﬁle server places no such restriction on the naming of ﬁle systems, or in requiring a default ﬁle system.
If you are developing ﬁle systems, there are two methods available which are useful for debugging:
TInt RFs::ControlIo(TInt aDrive,TInt,TAny*,TAny*)
This is a general-purpose method that provides a mechanism for passing information to and from the ﬁle system on a speciﬁed drive. The argument aDrive speciﬁes the drive number, but the assignment of the last three arguments is ﬁle system speciﬁc. Additionally, the following method can be used to request asynchronous notiﬁcation of a ﬁle system speciﬁc event:
void RFs::DebugNotify(TInt aDrive,TUint aNotifyType,
The argument aDrive speciﬁes the target drive number, aNotify- Type, speciﬁes the event, and aStat is a reference to a request status object that is signaled when the event occurs. To trigger the notiﬁer, the ﬁle system calls the following method, which is exported by the ﬁle server:
void DebugNotifySessions(TInt aFunction,TInt aDrive)
The argument aFunction speciﬁes the event that has occurred and aDrive indicates the drive on which this has occurred. So for example, if when testing, it is required for the test program to issue a particular request when a certain condition occurs in a ﬁle system then using DebugNotifySessions(), the ﬁle system can be conﬁgured to complete a pending debug notiﬁcation request whenever the condition occurs. All these methods are only available in debug builds.