RFsPlugin Class Reference

class RFsPlugin : private RFs

A class for making file server request internally from within a file server plugin.

See also RFilePlugin and RDirPlugin .

Inherits from

Public Member Functions
RFsPlugin ( TFsPluginRequest &, TBool )
~RFsPlugin ()
IMPORT_C void Close ()
IMPORT_C TInt Connect ()
IMPORT_C TInt Delete (const TDesC &)
IMPORT_C TInt Entry (const TDesC &, TEntry &)
IMPORT_C TInt ReadFileSection (const TDesC &, TInt64 , TDes8 &, TInt )
IMPORT_C TInt Rename (const TDesC &, const TDesC &)
IMPORT_C TInt Replace (const TDesC &, const TDesC &)
IMPORT_C TInt SetEntry (const TDesC &, const TTime &, TUint , TUint )
IMPORT_C TInt Volume ( TVolumeInfo &, TInt )
Protected Member Functions
TInt SendReceive ( TInt , const TIpcArgs &)
Private Member Functions
RFsPlugin ()
RFsPlugin (const RFsPlugin &)
void SetHandle ( TInt )
RFsPlugin & operator= (const RFsPlugin &)
Inherited Functions
RFs::AddCompositeMount(const TDesC &,TInt,TInt,TBool)const
RFs::AddExtension(const TDesC &)
RFs::AddFileSystem(const TDesC &)const
RFs::AddPlugin(const TDesC &)const
RFs::AddProxyDrive(const TDesC &)
RFs::AllowDismount(TInt)const
RFs::Att(const TDesC &,TUint &)const
RFs::CharToDrive(TChar,TInt &)
RFs::CheckDisk(const TDesC &)const
RFs::ClearPassword(TInt,const TMediaPassword &)
RFs::Connect(TInt)
RFs::ControlIo(TInt,TInt)
RFs::ControlIo(TInt,TInt,TAny *,TAny *)
RFs::ControlIo(TInt,TInt,TDes8 &)
RFs::ControlIo(TInt,TInt,TDes8 &,TDes8 &)
RFs::CreatePrivatePath(TInt)
RFs::DebugNotify(TInt,TUint,TRequestStatus &)
RFs::DefaultPath(TDes &)const
RFs::DismountExtension(const TDesC &,TInt)
RFs::DismountFileSystem(const TDesC &,TInt)const
RFs::DismountPlugin(const TDesC &)const
RFs::DismountPlugin(const TDesC &,TInt)const
RFs::DismountPlugin(const TDesC &,TInt,TInt)const
RFs::DismountProxyDrive(const TUint)
RFs::Drive(TDriveInfo &,TInt)const
RFs::DriveList(TDriveList &)const
RFs::DriveList(TDriveList &,TUint)const
RFs::DriveToChar(TInt,TChar &)
RFs::ErasePassword(TInt)
RFs::ExtensionName(TDes &,TInt,TInt)
RFs::FileSystemName(TDes &,TInt)const
RFs::FileSystemSubType(TInt,TDes &)const
RFs::FinaliseDrive(TInt,TFinaliseDrvMode)const
RFs::FinaliseDrives()
RFs::GetDir(const TDesC &,TUint,TUint,CDir *&)const
RFs::GetDir(const TDesC &,TUint,TUint,CDir *&,CDir *&)const
RFs::GetDir(const TDesC &,const TUidType &,TUint,CDir *&)const
RFs::GetDriveName(TInt,TDes &)const
RFs::GetLongName(const TDesC &,TDes &)const
RFs::GetMediaSerialNumber(TMediaSerialNumber &,TInt)
RFs::GetNotifyUser()
RFs::GetReserveAccess(TInt)
RFs::GetShortName(const TDesC &,TDes &)const
RFs::GetSystemDrive()
RFs::GetSystemDriveChar()
RFs::InitialisePropertiesFile(const TPtrC8 &)const
RFs::IsFileInRom(const TDesC &)const
RFs::IsFileOpen(const TDesC &,TBool &)const
RFs::IsRomAddress(TAny *)
RFs::IsValidDrive(TInt)
RFs::IsValidName(const TDesC &)const
RFs::IsValidName(const TDesC &,TNameValidParam &)
RFs::IsValidName(const TDesC &,TText &)const
RFs::LoaderHeapFunction(TInt,TAny *,TAny *)
RFs::LockDrive(TInt,const TMediaPassword &,const TMediaPassword &,TBool)
RFs::MkDir(const TDesC &)
RFs::MkDirAll(const TDesC &)
RFs::Modified(const TDesC &,TTime &)const
RFs::MountExtension(const TDesC &,TInt)
RFs::MountFileSystem(const TDesC &,TInt)const
RFs::MountFileSystem(const TDesC &,TInt,TBool)const
RFs::MountFileSystem(const TDesC &,const TDesC &,TInt)
RFs::MountFileSystem(const TDesC &,const TDesC &,TInt,TBool)
RFs::MountFileSystemAndScan(const TDesC &,TInt,TBool &)const
RFs::MountFileSystemAndScan(const TDesC &,const TDesC &,TInt,TBool &)const
RFs::MountPlugin(const TDesC &)const
RFs::MountPlugin(const TDesC &,TInt)const
RFs::MountPlugin(const TDesC &,TInt,TInt)const
RFs::MountProxyDrive(const TUint,const TDesC &,T0,T1)
RFs::NotifyChange(TNotifyType,TRequestStatus &)
RFs::NotifyChange(TNotifyType,TRequestStatus &,const TDesC &)
RFs::NotifyChangeCancel()
RFs::NotifyChangeCancel(TRequestStatus &)
RFs::NotifyDiskSpace(TInt64,TInt,TRequestStatus &)
RFs::NotifyDiskSpaceCancel()
RFs::NotifyDiskSpaceCancel(TRequestStatus &)
RFs::NotifyDismount(TInt,TRequestStatus &,TNotifyDismountMode)const
RFs::NotifyDismountCancel()const
RFs::NotifyDismountCancel(TRequestStatus &)const
RFs::Parse(const TDesC &,TParse &)const
RFs::Parse(const TDesC &,const TDesC &,TParse &)const
RFs::PluginName(TDes &,TInt,TInt)
RFs::PrivatePath(TDes &)
RFs::QueryVolumeInfoExt(TInt,TQueryVolumeInfoExtCmd,TDes8 &)const
RFs::RealName(const TDesC &,TDes &)const
RFs::ReleaseReserveAccess(TInt)
RFs::RemountDrive(TInt,const TDesC8 *,TUint)
RFs::RemoveExtension(const TDesC &)
RFs::RemoveFileSystem(const TDesC &)const
RFs::RemovePlugin(const TDesC &)const
RFs::RemoveProxyDrive(const TDesC &)
RFs::ReserveDriveSpace(TInt,TInt)
RFs::ResourceCount()const
RFs::ResourceCountMarkEnd()const
RFs::ResourceCountMarkStart()const
RFs::RmDir(const TDesC &)
RFs::ScanDrive(const TDesC &)const
RFs::SessionPath(TDes &)const
RFs::SetAllocFailure(TInt)
RFs::SetAtt(const TDesC &,TUint,TUint)
RFs::SetDebugRegister(TInt)
RFs::SetDefaultPath(const TDesC &)
RFs::SetDriveName(TInt,const TDesC &)
RFs::SetErrorCondition(TInt,TInt)
RFs::SetLocalDriveMapping(const TDesC8 &)
RFs::SetModified(const TDesC &,const TTime &)
RFs::SetNotifyChange(TBool)
RFs::SetNotifyUser(TBool)
RFs::SetSessionPath(const TDesC &)
RFs::SetSessionToPrivate(TInt)
RFs::SetStartupConfiguration(TInt,TAny *,TAny *)const
RFs::SetSubst(const TDesC &,TInt)
RFs::SetSystemDrive(TDriveNumber)
RFs::SetVolumeLabel(const TDesC &,TInt)
RFs::StartupInitComplete(TRequestStatus &)
RFs::Subst(TDes &,TInt)const
RFs::SupportedFileSystemName(TDes &,TInt,TInt)const
RFs::SwapFileSystem(const TDesC &,const TDesC &,TInt)const
RFs::Unclamp(const RFileClamp &)
RFs::UnlockDrive(TInt,const TMediaPassword &,TBool)
RFs::Version()const
RFs::Volume(TVolumeInfo &,TInt,TRequestStatus &)const
RFs::VolumeIOParam(TInt,TVolumeIOParamInfo &)const
RHandleBase::Attributes()const
RHandleBase::BTraceId()const
RHandleBase::DoExtendedClose()
RHandleBase::Duplicate(const RThread &,TOwnerType)
RHandleBase::FullName()const
RHandleBase::FullName(TDes &)const
RHandleBase::Handle()const
RHandleBase::HandleInfo(THandleInfo *)
RHandleBase::Name()const
RHandleBase::NotifyDestruction(TRequestStatus &)
RHandleBase::Open(const TFindHandleBase &,TOwnerType)
RHandleBase::OpenByName(const TDesC &,TOwnerType,TInt)
RHandleBase::RHandleBase()
RHandleBase::RHandleBase(TInt)
RHandleBase::SetHandleNC(TInt)
RSessionBase::CreateSession(RServer2,const TVersion &)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TRequestStatus *)
RSessionBase::Open(RMessagePtr2,TInt,TOwnerType)
RSessionBase::Open(RMessagePtr2,TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Open(TInt,TOwnerType)
RSessionBase::Open(TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Send(TInt)const
RSessionBase::Send(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt)const
RSessionBase::SendReceive(TInt,TRequestStatus &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
RSessionBase::SetReturnedHandle(TInt)
RSessionBase::SetReturnedHandle(TInt,RHandleBase &)
RSessionBase::SetReturnedHandle(TInt,const TSecurityPolicy &)
RSessionBase::ShareAuto()
RSessionBase::ShareProtected()
Inherited Enumerations
RFs:@37
RFs:TFinaliseDrvMode
RHandleBase:TAttributes
RSessionBase:TAttachMode
Private Attributes
TPluginSessionHelper iSessionHelper
Inherited Attributes
RHandleBase::iHandle

Constructor & Destructor Documentation

RFsPlugin(TFsPluginRequest &, TBool)

IMPORT_C RFsPlugin ( TFsPluginRequest & aRequest,
TBool aDirectToDrive = EFalse
)

Parameters

TFsPluginRequest & aRequest
TBool aDirectToDrive = EFalse

RFsPlugin()

RFsPlugin ( ) [private]

RFsPlugin(const RFsPlugin &)

RFsPlugin ( const RFsPlugin & ) [private]

Parameters

const RFsPlugin &

~RFsPlugin()

IMPORT_C ~RFsPlugin ( )

Member Functions Documentation

Close()

IMPORT_C void Close ( )

Connect()

IMPORT_C TInt Connect ( )

Delete(const TDesC &)

IMPORT_C TInt Delete ( const TDesC & aName )

Deletes a single file.

Wildcards are not allowed in either the file name or the extension, otherwise an error is returned.

Note that the file must be closed and must not be read-only. Hidden files can be deleted but system files cannot.

See class CFileMan for information on deleting multiple files.

capability
Dependent If aName is /Sys then Tcb capability is required.
capability
Dependent If aName begins with /Private and does not match this process' SID then AllFiles capability is required.
capability
Dependent If aName is /Resource then Tcb capability is required.
CFileMan

Parameters

const TDesC & aName The name of the file to be deleted. Any path components which are not specified here will be taken from the session path.

Entry(const TDesC &, TEntry &)

IMPORT_C TInt Entry ( const TDesC & aName,
TEntry & anEntry
) const

Gets the entry details for a file or directory.

This information includes UID information.

capability
Dependent If aName contains "\\Sys\\" and includes an additional file or directory then AllFiles capability is required. For example, the paths "c:\\sys" and "c:\\sys\\" will always be readable, whereas the path "c:\\sys\\abc\\" will only be readable with AllFiles capability.
capability
Dependent If aName contains \Private\ and includes an additional file, or a directory which does not match this process' SID, then AllFiles capability is required. For example, the paths "c:\\private" and "c:\\private\\" will always be readable, whereas the path "c:\\private\\<n>\\" will only be readable with AllFiles capability or if <n> matches the process' SID.

Parameters

const TDesC & aName Name of file or directory.
TEntry & anEntry On return, contains the entry details for the file or directory. TEntry::iModified contains UTC date and time.

ReadFileSection(const TDesC &, TInt64, TDes8 &, TInt)

IMPORT_C TInt ReadFileSection ( const TDesC & aName,
TInt64 aPos,
TDes8 & aDes,
TInt aLength
) const

Reads data from a file without opening it.

The contents of the file can be accessed regardless of the file's lock state.

The file may be open by any number of other clients for reading or writing. In allowing such access to a file, the fileserver makes no guarantees as to the validity of the data it returns.

panic
FSCLIENT 19 if aPos negative.
panic
FSCLIENT 27 if aLength is greater than the maximum length of the target descriptor.
capability
Dependent If the path for aName starts with /Sys capability AllFiles is required
capability
Dependent If the path for aName starts with /Private and this process does not have the relevant SID capability AllFiles is required

Parameters

const TDesC & aName Name of the file to be accessed.
TInt64 aPos The offset, in bytes, from the start of the file where reading is to start.
TDes8 & aDes On return, contains the data read from the file. The length of the descriptor is set to the number of bytes read. If the specified offset lies beyond the end of the file, no data is read and the length of this descriptor is set to zero.
TInt aLength The number of bytes to be read from the file.

Rename(const TDesC &, const TDesC &)

IMPORT_C TInt Rename ( const TDesC & anOldName,
const TDesC & aNewName
)

Renames a single file or directory.

It can also be used to move a file or directory by specifying different destination and source directories. If so, the destination and source directories must be on the same drive. If a directory is moved, then the directory structure beneath it is also moved.

If a directory specified by aNewName is different from one specified by anOldName, then the file or directory is moved to the new directory. The file or directory cannot be moved to another device by this means, either explicitly (by another drive specified in the name) or implicitly (because the directory has been mapped to another device with SetSubst() .

The function fails and returns an error code in the following circumstances:

1. If either the old or new name includes wildcards.

2. If a file or directory with the new name already exists in the target directory. Overwriting is not permitted.

3. If file anOldName does not exist, or is open.

Read-only, system and hidden files may be renamed. The renamed file's attributes are preserved.

Note that when this function is operating on directories, a trailing backslash is not required after the final directory name in either anOldName or aNewName.

See class CFileMan for information on renaming multiple files.

capability
Dependent If either anOldName or aNewName is /Sys then Tcb capability is required.
capability
Dependent If either anOldName or aNewName begins with /Private and does not match this process' SID then AllFiles capability is required.
capability
Dependent If either anOldName or aNewName is /Resource then Tcb capability is required.
CFileMan

Parameters

const TDesC & anOldName File or directory to be renamed. Any path components which are not specified here will be taken from the session path.
const TDesC & aNewName Path specifying the new name for the file or directory and/or its new parent directory. All directories specified in this path must exist. Any path components which are not specified here will be taken from the session path.

Replace(const TDesC &, const TDesC &)

IMPORT_C TInt Replace ( const TDesC & anOldName,
const TDesC & aNewName
)

Replaces a single file with another.

This function does not support the use of wildcards. Unlike Rename() , it only applies to files.

This function operates as follows:

1. if the aNewName file does not exist, it is created.

2. anOldName's contents, attributes and the date and time of its last modification are copied to file aNewName, overwriting any existing contents and attribute details.

3. anOldName is deleted.

anOldName may be hidden, read-only or a system file. However, neither anOldName, nor, if it exists, aNewName, can be open; aNewName must not be read-only. Both files must be on the same drive.

capability
Dependent If either anOldName or aNewName is /Sys then Tcb capability is required.
capability
Dependent If either anOldName or aNewName begins with /Private and does not match this process' SID then AllFiles capability is required.
capability
Dependent If either anOldName or aNewName is /Resource then Tcb capability is required.

Parameters

const TDesC & anOldName The file to be replaced. Must exist and must be closed. It is deleted by this function.
const TDesC & aNewName The file to replace anOldName. Does not need to exist, but if it does exist, it must be closed. If it exists, its name remains unchanged but its contents, attributes and the date and time of its last modification are replaced by those of anOldName. If it does not exist, it will be created and is assigned the contents and attributes of anOldName. Must not be followed by a trailing backslash.

SendReceive(TInt, const TIpcArgs &)

TInt SendReceive ( TInt aFunction,
const TIpcArgs & aArgs
) const [protected]

Issues a synchronous request to the server with the specified function number and arguments.

panic
USER 72 if the function number is negative.

Parameters

TInt aFunction The function number identifying the request.
const TIpcArgs & aArgs A set of up to 4 arguments and their types to be passed to the server.

SetEntry(const TDesC &, const TTime &, TUint, TUint)

IMPORT_C TInt SetEntry ( const TDesC & aName,
const TTime & aTime,
TUint aSetAttMask,
TUint aClearAttMask
)

Sets both the attributes and the last modified date and time for a file or directory.

The function uses two bitmasks. The first bitmask determines which attributes should be set. The second bitmask determines which should be cleared.

An attempt to set or clear the KEntryAttDir, KEntryAttVolume or KEntryAttRemote attributes have no effect.

panic
FSCLIENT 21 if any attribute appears in both bitmasks.
capability
Dependent If aName is /Sys then Tcb capability is required.
capability
Dependent If aName begins with /Private and does not match this process' SID then AllFiles capability is required.
capability
Dependent If aName is /Resource then Tcb capability is required.
KEntryAttNormal KEntryAttDir KEntryAttVolume

Parameters

const TDesC & aName File or directory name.
const TTime & aTime New date and time. UTC date and time should be used.
TUint aSetAttMask Bitmask indicating which attributes are to be set.
TUint aClearAttMask Bitmask indicating which attributes are cleared. For more information, see KEntryAttNormal, and the other file or directory attributes.

SetHandle(TInt)

void SetHandle ( TInt aHandle ) [private]

Sets the handle-number of this handle to the specified value.

Parameters

TInt aHandle The handle-number to be set.

Volume(TVolumeInfo &, TInt)

IMPORT_C TInt Volume ( TVolumeInfo & aVol,
TInt aDrive =  KDefaultDrive
) const

Gets volume information for a formatted device.

This function provides additional information to that given by Drive() , including the volume label, if set, and the amount of free space on the disk.

Note, use Drive() to get information about the drive without reference to a volume. These two functions are separate because, while the characteristics of a drive cannot change, those of a volume can, by mounting different media, reformatting etc. A volume may not even be present if the media is removable.

RFs::Drive

Parameters

TVolumeInfo & aVol On return, contains the volume information.
TInt aDrive =  KDefaultDrive The drive which contains the media for which volume information is to be displayed. Specify a drive in the range EDriveA to EDriveZ for drives A to Z respectively. The default drive is the session default drive KDefaultDrive.

operator=(const RFsPlugin &)

RFsPlugin & operator= ( const RFsPlugin & ) [private]

Parameters

const RFsPlugin &

Member Data Documentation

TPluginSessionHelper iSessionHelper

TPluginSessionHelper iSessionHelper [private]