RFs Class Reference

#include <f32file.h>

Link against: efsrv.lib

class RFs : public RSessionBase, public RSessionBase

Nested Classes and Structures

Public Member Enumerations
enumanonymous { KRootFileSystem, KFirstChildFileSystem }
enumTFinaliseDrvMode { EFinal_RW, EFinal_RO, EForceUnfinalise }
enumTForceMediaChangeFlags { KForceMediaChangeReOpenAllMediaDrivers, KMediaRemountForceMediaChange, KForceMediaChangeReOpenMediaDriver }
Public Member Functions
IMPORT_C TIntAddCompositeMount(const TDesC &, TInt, TInt, TBool)
IMPORT_C TIntAddExtension(const TDesC &)
IMPORT_C TIntAddFileSystem(const TDesC &)
IMPORT_C TIntAddPlugin(const TDesC &)
IMPORT_C TIntAddProxyDrive(const TDesC &)
IMPORT_C TIntAllowDismount(TInt)
IMPORT_C TIntAtt(const TDesC &, TUint &)
IMPORT_C TIntCharToDrive(TChar, TInt &)
IMPORT_C TIntCheckDisk(const TDesC &)
IMPORT_C TIntClearPassword(TInt, const TMediaPassword &)
IMPORT_C voidClose()
IMPORT_C TIntConnect(TInt)
IMPORT_C TIntControlIo(TInt, TInt)
IMPORT_C TIntControlIo(TInt, TInt, TDes8 &)
IMPORT_C TIntControlIo(TInt, TInt, TDes8 &, TDes8 &)
IMPORT_C TIntControlIo(TInt, TInt, TAny *, TAny *)
IMPORT_C TIntCreatePrivatePath(TInt)
IMPORT_C voidDebugNotify(TInt, TUint, TRequestStatus &)
IMPORT_C TIntDefaultPath(TDes &)
IMPORT_C TIntDelete(const TDesC &)
IMPORT_C TIntDismountExtension(const TDesC &, TInt)
IMPORT_C TIntDismountFileSystem(const TDesC &, TInt)
IMPORT_C TIntDismountPlugin(const TDesC &)
IMPORT_C TIntDismountPlugin(const TDesC &, TInt)
IMPORT_C TIntDismountPlugin(const TDesC &, TInt, TInt)
IMPORT_C TIntDismountProxyDrive(const TUint)
IMPORT_C TIntDrive(TDriveInfo &, TInt)
IMPORT_C TIntDriveList(TDriveList &)
IMPORT_C TIntDriveList(TDriveList &, TUint)
IMPORT_C TIntDriveToChar(TInt, TChar &)
IMPORT_C TIntEntry(const TDesC &, TEntry &)
IMPORT_C TIntErasePassword(TInt)
IMPORT_C TIntExtensionName(TDes &, TInt, TInt)
IMPORT_C TIntFileSystemName(TDes &, TInt)
IMPORT_C TIntFileSystemSubType(TInt, TDes &)
IMPORT_C TIntFinaliseDrive(TInt, TFinaliseDrvMode)
IMPORT_C TIntFinaliseDrives()
IMPORT_C TIntGetDir(const TDesC &, TUint, TUint, CDir *&)
IMPORT_C TIntGetDir(const TDesC &, TUint, TUint, CDir *&, CDir *&)
IMPORT_C TIntGetDir(const TDesC &, const TUidType &, TUint, CDir *&)
IMPORT_C TIntGetDriveName(TInt, TDes &)
IMPORT_C TIntGetLongName(const TDesC &, TDes &)
IMPORT_C TIntGetMediaSerialNumber(TMediaSerialNumber &, TInt)
IMPORT_C TBoolGetNotifyUser()
IMPORT_C TIntGetReserveAccess(TInt)
IMPORT_C TIntGetShortName(const TDesC &, TDes &)
IMPORT_C TDriveNumberGetSystemDrive()
IMPORT_C TCharGetSystemDriveChar()
IMPORT_C TIntInitialisePropertiesFile(const TPtrC8 &)
IMPORT_C TUint8 *IsFileInRom(const TDesC &)
IMPORT_C TIntIsFileOpen(const TDesC &, TBool &)
IMPORT_C TBoolIsRomAddress(TAny *)
IMPORT_C TBoolIsValidDrive(TInt)
IMPORT_C TBoolIsValidName(const TDesC &)
IMPORT_C TBoolIsValidName(const TDesC &, TText &)
IMPORT_C TBoolIsValidName(const TDesC &, TNameValidParam &)
IMPORT_C TIntLoaderHeapFunction(TInt, TAny *, TAny *)
IMPORT_C TIntLockDrive(TInt, const TMediaPassword &, const TMediaPassword &, TBool)
IMPORT_C TIntMkDir(const TDesC &)
IMPORT_C TIntMkDirAll(const TDesC &)
IMPORT_C TIntModified(const TDesC &, TTime &)
IMPORT_C TIntMountExtension(const TDesC &, TInt)
IMPORT_C TIntMountFileSystem(const TDesC &, TInt)
IMPORT_C TIntMountFileSystem(const TDesC &, TInt, TBool)
IMPORT_C TIntMountFileSystem(const TDesC &, const TDesC &, TInt)
IMPORT_C TIntMountFileSystem(const TDesC &, const TDesC &, TInt, TBool)
IMPORT_C TIntMountFileSystemAndScan(const TDesC &, TInt, TBool &)
IMPORT_C TIntMountFileSystemAndScan(const TDesC &, const TDesC &, TInt, TBool &)
IMPORT_C TIntMountPlugin(const TDesC &)
IMPORT_C TIntMountPlugin(const TDesC &, TInt)
IMPORT_C TIntMountPlugin(const TDesC &, TInt, TInt)
TInt MountProxyDrive(const TUint, const TDesC &, T0, T1)
IMPORT_C voidNotifyChange(TNotifyType, TRequestStatus &)
IMPORT_C voidNotifyChange(TNotifyType, TRequestStatus &, const TDesC &)
IMPORT_C voidNotifyChangeCancel()
IMPORT_C voidNotifyChangeCancel(TRequestStatus &)
IMPORT_C voidNotifyDiskSpace(TInt64, TInt, TRequestStatus &)
IMPORT_C voidNotifyDiskSpaceCancel(TRequestStatus &)
IMPORT_C voidNotifyDiskSpaceCancel()
IMPORT_C voidNotifyDismount(TInt, TRequestStatus &, TNotifyDismountMode)
IMPORT_C voidNotifyDismountCancel(TRequestStatus &)
IMPORT_C voidNotifyDismountCancel()
IMPORT_C TIntParse(const TDesC &, TParse &)
IMPORT_C TIntParse(const TDesC &, const TDesC &, TParse &)
IMPORT_C TIntPluginName(TDes &, TInt, TInt)
IMPORT_C TIntPrivatePath(TDes &)
IMPORT_C TIntQueryVolumeInfoExt(TInt, TQueryVolumeInfoExtCmd, TDes8 &)
IMPORT_C TIntReadFileSection(const TDesC &, TInt64, TDes8 &, TInt)
IMPORT_C TIntRealName(const TDesC &, TDes &)
IMPORT_C TIntReleaseReserveAccess(TInt)
IMPORT_C TIntRemountDrive(TInt, const TDesC8 *, TUint)
IMPORT_C TIntRemoveExtension(const TDesC &)
IMPORT_C TIntRemoveFileSystem(const TDesC &)
IMPORT_C TIntRemovePlugin(const TDesC &)
IMPORT_C TIntRemoveProxyDrive(const TDesC &)
IMPORT_C TIntRename(const TDesC &, const TDesC &)
IMPORT_C TIntReplace(const TDesC &, const TDesC &)
IMPORT_C TIntReserveDriveSpace(TInt, TInt)
IMPORT_C TIntResourceCount()
IMPORT_C voidResourceCountMarkEnd()
IMPORT_C voidResourceCountMarkStart()
IMPORT_C TIntRmDir(const TDesC &)
IMPORT_C TIntScanDrive(const TDesC &)
IMPORT_C TIntSessionPath(TDes &)
IMPORT_C TIntSetAllocFailure(TInt)
IMPORT_C TIntSetAtt(const TDesC &, TUint, TUint)
IMPORT_C TIntSetDebugRegister(TInt)
IMPORT_C TIntSetDefaultPath(const TDesC &)
IMPORT_C TIntSetDriveName(TInt, const TDesC &)
IMPORT_C TIntSetEntry(const TDesC &, const TTime &, TUint, TUint)
IMPORT_C TIntSetErrorCondition(TInt, TInt)
IMPORT_C TIntSetLocalDriveMapping(const TDesC8 &)
IMPORT_C TIntSetModified(const TDesC &, const TTime &)
IMPORT_C TIntSetNotifyChange(TBool)
IMPORT_C voidSetNotifyUser(TBool)
IMPORT_C TIntSetSessionPath(const TDesC &)
IMPORT_C TIntSetSessionToPrivate(TInt)
IMPORT_C TIntSetStartupConfiguration(TInt, TAny *, TAny *)
IMPORT_C TIntSetSubst(const TDesC &, TInt)
IMPORT_C TIntSetSystemDrive(TDriveNumber)
IMPORT_C TIntSetVolumeLabel(const TDesC &, TInt)
IMPORT_C voidStartupInitComplete(TRequestStatus &)
IMPORT_C TIntSubst(TDes &, TInt)
IMPORT_C TIntSupportedFileSystemName(TDes &, TInt, TInt)
IMPORT_C TIntSwapFileSystem(const TDesC &, const TDesC &, TInt)
TInt Unclamp(const RFileClamp &)
IMPORT_C TIntUnlockDrive(TInt, const TMediaPassword &, TBool)
IMPORT_C TVersionVersion()
IMPORT_C TIntVolume(TVolumeInfo &, TInt)
IMPORT_C voidVolume(TVolumeInfo &, TInt, TRequestStatus &)
IMPORT_C TIntVolumeIOParam(TInt, TVolumeIOParamInfo &)
Protected Member Functions
TInt SendReceive(TInt, const TIpcArgs &)
Inherited Attributes
RHandleBase::iHandle
Inherited Enumerations
RHandleBase:TAttributes
RSessionBase:TAttachMode
Inherited Functions
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::SetHandle(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()

Detailed Description

A handle to a file server session.

A program or thread may have arbitrarily many sessions open simultaneously.

Use this class for all file system manipulation, including:

1. adding, removing, moving and renaming files and directories

2. inspecting and changing file attributes and directory entry details. These include the time and date when the file or directory was last written to, its size and various attribute flags such as read-only, hidden, archive or system.

3. finding a files real name; if the file system on which it is stored has to "mangle" the name into a shorter format

4. getting directory listings

5. maintaining a default path; unlike some other systems, there is a single system default path, rather than one for each drive: the default path consists of a drive and a path specification.

6. performing context-sensitive parses using TParse objects, and the session path

7. obtaining information on drives and volumes

8. formatting and labelling volumes

9. obtaining a list of valid drives

10. emulating the DOS subst command, which allows any directory to appear as if it were a separate drive

11. requesting notification of when significant change occurs. This can be used for programs which maintain file lists, but must update those lists when change occurs.

12. finding the version number of the file server

13. resource counting to ensure that all resources are closed when the session terminates.

This class is not intended for user derivation.

The following restrictions apply when a path is specified:

1. its total length must not exceed 256 characters

2. wildcards cannot be used in the drive or in any directory name, although they may be allowed in the filename and extension.

3. double backslashes are not allowed in the path.

4. the following characters must not be included anywhere in the path: < > " / |

5. a colon may only be included between the drive and path

6. no directory name or filename plus extension may consist solely of space characters, or of a single or double dot.

7. spaces between the drive, if specified, and the first directory in the path are illegal, although there may be spaces between other path components, for instance between directories.

Member Enumeration Documentation

Enum anonymous

Special enumerator values for the SupportedFileSystemName() API

EnumeratorValueDescription
KRootFileSystem0x00800000
KFirstChildFileSystem0

Enum TFinaliseDrvMode

specifies drive finalisation modes

EnumeratorValueDescription
EFinal_RW
EFinal_RO
EForceUnfinalise

Enum TForceMediaChangeFlags

A set of special flags passed directly to the media driver via RFs::RemountDrive() API. They are used to specify how exactly the drive should be remounted. For more information see RLocalDrive::ForceMediaChange()

See also: RFs::RemountDrive()

EnumeratorValueDescription
KForceMediaChangeReOpenAllMediaDrivers0

Passing this flag to RFs::RemountDrive() API results in all media drivers associated with the primary media being closed and reopened. All pending requests on all logical drives associated with the primary media will be cancelled.

KMediaRemountForceMediaChange0x00000001

This flag is used to simulate ejecting and re-inserting the media. All pending requests on all logical drives associated with the primary media will be cancelled.

KForceMediaChangeReOpenMediaDriver0x80000000

This flag is used to force the media driver for the specified logical drive to be closed and reopened. It should not affect any pending requests on other logical drives associated with the primary media.

Member Function Documentation

AddCompositeMount ( const TDesC &, TInt, TInt, TBool )

IMPORT_C TIntAddCompositeMount(const TDesC &aFileSystemName,
TIntaLocalDriveToMount,
TIntaCompositeDrive,
TBoolaSync
)const

Adds a local drive to the composite filesystem. This can only be used before the composite filesystem is mounted. The local drive is mounted with the filesystem provided. If any local drive added is marked to be asynchronous, then the whole composite drive will be treated asynchronous.

Parameters
aFileSystemNameThe filesystem of the local drive to be added.
aLocalDriveToMountThe local drive to be added.
aCompositeDriveThe drive the composite filesystem will be mounted on.
aSyncIf the filesystem added here is preferred to be synchronous.
Return Value
KErrNone if successful KErrNotFound If the filesystem name provided could not be found. KErrNotReady If the composite filesystem has not been initialised. KErrNotSupported If the composite filesystem is already mounted or the parameters passed are unsupported
Capability
DiskAdmin

AddExtension ( const TDesC & )

IMPORT_C TIntAddExtension(const TDesC &aFileName)

Load file system extension module and add it to the file server.

See also: RFs::AddFileSystem

Parameters
aFileNameThe file name of the extension
Return Value
KErrNone, if successful; otherwise one of the other system wide error codes.

AddFileSystem ( const TDesC & )

IMPORT_C TIntAddFileSystem(const TDesC &aFileName)const

Load file system plugin (*.fsy module) and add a file system that it implements to the file server. After loading the file system plugin RFs::MountFileSystem() can be used to mount the file system on a drive.

See also: RFs::MountFileSystem

Parameters
aFileNameThe name of the file system plugin (*.FSY) to install. If only file name without extension is specified, ".fsy" extension is assumed by default. A full path to the FSY module can be specified, otherwise standard rules of loading DLLs apply.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.
Capability
DiskAdmin

AddPlugin ( const TDesC & )

IMPORT_C TIntAddPlugin(const TDesC &aFileName)const

Loads a specified Plugin.

Parameters
aFileNameThe file name of the plugin
Return Value
KErrNone, if successful; otherwise one of the other system wide error codes.
Capability
DiskAdmin

AddProxyDrive ( const TDesC & )

IMPORT_C TIntAddProxyDrive(const TDesC &aFileName)

Loads the specified extension.

Parameters
aFileNameThe file name of the extension
Return Value
KErrNone, if successful; otherwise one of the other system wide error codes.

AllowDismount ( TInt )

IMPORT_C TIntAllowDismount(TIntaDrive)const

Used by a client to indicate that it is safe to dismount the file system. This should be called after receiving a pending media removal notification.

Not calling this does not guarantee that the dismount will not occur as the application requesting the dismount may decide to forcibly dismount after a given timeout period.

See also: RFs::NotifyDismount

Return Value
KErrNone if successful

Att ( const TDesC &, TUint & )

IMPORT_C TIntAtt(const TDesC &aName,
TUint &aAttValue
)const

Gets a file's attributes.

See also: KEntryAttNormal

Parameters
aNameThe filename. Any path components which are not specified here will be taken from the session path.
aAttValueOn return, the individual bits within the byte indicate which attributes have been set. For more information see KEntryAttNormal and the other file/directory attributes.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.
Capability
DependentIf aName contains /sys/ then AllFiles capability is required.
DependentIf aName contains /Private/ and does not match this process' SID then AllFiles capability is required.

CharToDrive ( TChar, TInt & )

IMPORT_C TIntCharToDrive(TCharaChar,
TInt &aDrive
)[static]

Maps a drive character to a drive number.

The drive character must be in the range A to Z or a to z. For example, drive A (or a) corresponds to zero, drive B (or b) corresponds to 1 etc. For the drive number enumeration, see TDriveNumber.

See also: TDriveNumber

Parameters
aCharThe drive character.
aDriveOn return, contains the drive number.
Return Value
KErrNone, if successful; KErrArgument, if the drive character is not in the range A to Z or a to z.

CheckDisk ( const TDesC & )

IMPORT_C TIntCheckDisk(const TDesC &aDrive)const

Checks the integrity of the File System mounted on the specified drive. The behaviour of this API and return codes are File System specific, dependent on how the File System implements its CheckDisk functionality. Note that CheckDisk does not fix any errors that may be found, it just reports the first problem it has found.

FAT File System specific information:

CheckDisk checks for a limited amount of possible corruption cases such as invalid cluster numbers in the FAT table, lost and cross-linked cluster chains, various errors within the directory entry etc.

If CheckDisk returns KErrNone, this means that there are no errors that CheckDisk on FAT is aware of.

Error codes returned by the FAT version of CheckDisk include: 1 Bad cluster value in FAT table detected. 2 Cross-linked cluster chain detected. 3 Lost cluster chain detected. 4 File size does not correspond to the number of clusters reported in the FAT table.

Parameters
aDrivePath containing the drive to be checked. If the drive letter is not specified, the current session drive is taken by default.
Return Value
KErrNone If CheckDisk has not found any errors it knows about. KErrNotReady If the specified drive is not ready. KErrNotSupported If this functionality is not supported. KErrPermissionDenied If the caller does not have DiskAdmin capability. Other system-wide error codes.
Capability
DiskAdmin

ClearPassword ( TInt, const TMediaPassword & )

IMPORT_C TIntClearPassword(TIntaDrv,
const TMediaPassword &aPswd
)

Clears the password from the locked MultiMedia card in the specified drive.

Clearing the password causes the MultiMedia card controller to set the password to null.

Parameters
aDrvThe drive.
aPswdThe current password, which is required to perform this operation.
Return Value
KErrNone, if successful; KErrAccessDenied, if the password is wrong or the card is still locked; otherwise one of the other system-wide error codes.
Capability
DiskAdmin

Close ( )

IMPORT_C voidClose()

Reimplemented from RHandleBase::Close()

Closes the file server session.

NB This function was added to support tracing and was not present in earlier versions of Symbian OS. For this reason no extra funcitonality should be added to this function.

Connect ( TInt )

IMPORT_C TIntConnect(TIntaMessageSlots =  KFileServerDefaultMessageSlots )

Connects a client to the file server.

To end the file server session, use Close().

Parameters
aMessageSlotsThe number of message slots required. The default value of KFileServerDefaultMessageSlots indicates that message slots will be acquired dynamically from the system wide pool. Override this value with a fixed number, if a fixed number of slots are to be allocated to the session. If overriding, note that the number of message slots represents the number of operations, such as reads and writes, that can be outstanding at once; always remember to provide a spare slot for the cancel operation.
Return Value
KErrNone, if successful, otherwise one of the other system-wide error codes.

ControlIo ( TInt, TInt )

IMPORT_C TIntControlIo(TIntaDrive,
TIntaCommand
)

General purpose test interface - file system specific.

This function can only be used in debug builds or if _USE_CONTROLIO, _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.

There are drive specific and non-drive specific commands. Following are non-drive specific commands

See also: RFs::TDriveNumber()

Parameters
aDriveA drive on which aCommand is to be executed; this can be one of the values defined by TDriveNumber.
aCommandA command to be executed, specific to the file system implementation.
Return Value
On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds. KErrNotSupported in release build.

ControlIo ( TInt, TInt, TDes8 & )

IMPORT_C TIntControlIo(TIntaDrive,
TIntaCommand,
TDes8 &aParam1
)

General purpose test interface - file system specific.

This function can only be used in debug builds or if _USE_CONTROLIO, _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.

See also: RFs::TDriveNumber()

Parameters
aDriveA drive on which aCommand is to be executed; this can be one of the values defined by TDriveNumber.
aCommandA command to be executed, specific to the file system implementation.
aParam1Placeholder for a parameter, specific to the file system implementation.
Return Value
On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds. KErrNotSupported in release build.

ControlIo ( TInt, TInt, TDes8 &, TDes8 & )

IMPORT_C TIntControlIo(TIntaDrive,
TIntaCommand,
TDes8 &aParam1,
TDes8 &aParam2
)

General purpose test interface - file system specific.

This function can only be used in debug builds or if _USE_CONTROLIO, _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.

See also: RFs::TDriveNumber()

Parameters
aDriveA drive on which aCommand is to be executed; this can be one of the values defined by TDriveNumber.
aCommandA command to be executed, specific to the file system implementation.
aParam1Placeholder for a parameter, specific to the file system implementation.
aParam2Placeholder for a parameter, specific to the file system implementation.
Return Value
On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds. KErrNotSupported in release build.

ControlIo ( TInt, TInt, TAny *, TAny * )

IMPORT_C TIntControlIo(TIntaDrive,
TIntaCommand,
TAny *aParam1,
TAny *aParam2
)

General purpose test interface - file system specific.

This function can only be used in debug builds or if _USE_CONTROLIO, _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.

See also: RFs::TDriveNumber()

Parameters
aDriveA drive on which aCommand is to be executed; this can be one of the values defined by TDriveNumber.
aCommandA command to be executed, specific to the file system implementation.
aParam1Placeholder for a parameter, specific to the file system implementation.
aParam2Placeholder for a parameter, specific to the file system implementation.
Return Value
On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds. KErrNotSupported in release build.

CreatePrivatePath ( TInt )

IMPORT_C TIntCreatePrivatePath(TIntaDrive)

Creates the private path for a process on the specified drive.

The private path for a process has the form: \Private\13579BDF\ where 13579BDF is the identity of the process.

Parameters
aDriveThe drive for which the private path is to be created. Specify a drive in the range EDriveA to EDriveZ for drives A to Z respectively.
Return Value
KErrNone, if successful, otherwise one of the other system-wide error codes.

DebugNotify ( TInt, TUint, TRequestStatus & )

IMPORT_C voidDebugNotify(TIntaDrive,
TUintaNotifyType,
TRequestStatus &aStat
)

Request notification of a file server event - file system specific.

This function can only be used in debug builds or if _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.

See also: RFs::TDriveNumber() TRequestStatus

Parameters
aDriveA drive on which the file server event notification is requested; this can be one of the values defined by TDriveNumber.
aNotifyTypeA number identifying the event that should cause notification;
aStatThe request status used to contain completion information for the function. On completion, contains a system-wide error code.

DefaultPath ( TDes & )

IMPORT_C TIntDefaultPath(TDes &aPath)const

Delete ( const TDesC & )

IMPORT_C TIntDelete(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.

See also: CFileMan

Parameters
aNameThe name of the file to be deleted. Any path components which are not specified here will be taken from the session path.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.
Capability
DependentIf aName is /Sys then Tcb capability is required.
DependentIf aName begins with /Private and does not match this process' SID then AllFiles capability is required.
DependentIf aName is /Resource then Tcb capability is required.

DismountExtension ( const TDesC &, TInt )

IMPORT_C TIntDismountExtension(const TDesC &aExtensionName,
TIntaDrive
)

Dismounts the specified extension.

See also: RFs::ExtensionName

Parameters
aExtensionNameThe fullname of the extension, as returned from a call to ExtensionName().
aDriveThe drive this extension is to be dismounted from.
Return Value
KErrNone if successful; KErrNotFound if the extension cannot be found; otherwise one of the other system-wide error codes.

DismountFileSystem ( const TDesC &, TInt )

IMPORT_C TIntDismountFileSystem(const TDesC &aFileSystemName,
TIntaDrive
)const

Dismounts the file system from the specified drive. Note that is not possible to dismount a file system if its has objects opened, like files, directories, formats etc.

See also: RFs::FileSystemName

Parameters
aFileSystemNameThe name the file system, like "FAT". Note that this is _not_ the name of the plugin (*.fsy). The file system name is case-insensitive, i.e. "FAT", "fat", "Fat" are equivalent. The maximum lentgth of the file name is KMaxFSNameLength. The file system name on the drive can be retrieved by a call to RFs::FileSystemName().
aDriveThe drive number from which the file system is to be dismounted.
Return Value
KErrNone, if successful; KErrNotFound, if aFileSystemName is not found; KErrNotReady, if the drive does not have a file system mounted on it; KErrInUse, if the drive has a resource open on it; KErrAccessDenied, if there is an attempt to dismount a ROM file system, a substituted drive, or the drive which is the default drive; KErrArgument, if the specified drive value is outsdide of the valid range. KErrPermissionDenied, if the client does not have the necessary capabilities to dismount the file system.
Capability
DiskAdmin

DismountPlugin ( const TDesC & )

IMPORT_C TIntDismountPlugin(const TDesC &aPluginName)const

Dismounts the specified plugin from all drives on which it is mounted.

See also: RFs::PluginName

Parameters
aPluginNameThe fullname of the plugin, as returned from a call to PluginName().
Return Value
KErrNone if successful; KErrNotFound, if the plugin cannot be found; otherwise one of the other system-wide error codes.
Capability
DiskAdmin

DismountPlugin ( const TDesC &, TInt )

IMPORT_C TIntDismountPlugin(const TDesC &aPluginName,
TIntaDrive
)const

Dismounts the specified plugin.

See also: RFs::PluginName

Parameters
aPluginNameThe fullname of the plugin, as returned from a call to PluginName().
aDriveThe drive on which the plugin is to be dismounted; If the mounted plugin is a version2 plugin, then in order to dismount drive z, KPluginMountDriveZ should be passed as a parameter. For all other drive letters use values 0 to 24 for A to Y. Version1 plugins cannot mount on Z drive.
Return Value
KErrNone if successful; KErrNotFound, if the plugin cannot be found; otherwise one of the other system-wide error codes.
Capability
DiskAdmin

DismountPlugin ( const TDesC &, TInt, TInt )

IMPORT_C TIntDismountPlugin(const TDesC &aPluginName,
TIntaDrive,
TIntaPos
)const

Dismounts the specified plugin.

See also: RFs::PluginName

Parameters
aPluginNameThe fullname of the plugin, as returned from a call to PluginName().
aDriveIf the mounted plugin is a version2 plugin, then in order to dismount drive z, KPluginMountDriveZ should be passed as a parameter. For all other drive letters use values 0 to 24 for A to Y. Version1 plugins cannot mount on Z drive.
aPosThe position at which the plugin is located in the internal array of plugins. To automatically locate the position of the plugin use DismountPlugin::(TDesC&,TInt) or DismountPlugin::(TDesC&)
Return Value
KErrNone if successful; KErrNotFound, if the plugin cannot be found; otherwise one of the other system-wide error codes.
Capability
DiskAdmin

DismountProxyDrive ( const TUint )

IMPORT_C TIntDismountProxyDrive(const TUintaDrive)

Dismounts a proxy drive.

Parameters
aDrivedrive number that will be used to mount the proxy drive
Return Value
If succesful the internal drive number used to represent the drive (equivalent to a local drive number for normal drives) This number is obtained dynmically. The number will range between KMaxLocalDrives and KMaxDrives. KErrInUse if aProxyDriveNumber is in use or if there are not proxy drive numbers left KErrArgument if aProxyDriveNumber or aName are invalid Any other system wide error code.

Drive ( TDriveInfo &, TInt )

IMPORT_C TIntDrive(TDriveInfo &anInfo,
TIntaDrive = KDefaultDrive
)const

Gets information about a drive and the medium mounted on it.

Note that Volume() can also be used to give information about the drive and the volume mounted on it. 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.

See also: RFs::Volume

Parameters
anInfoOn return, contains information describing the drive and the medium mounted on it. The value of TDriveInfo::iType shows whether the drive contains media.
aDriveThe drive for which information is requested. Specify KDefaultDrive for the session default drive. Specify a drive in the range EDriveA to EDriveZ for drives A to Z respectively.
Return Value
KErrNone, if successful, otherwise one of the other system-wide error codes.

DriveList ( TDriveList & )

IMPORT_C TIntDriveList(TDriveList &aList)const

Gets a list of the available (not remote and non hidden) drives.

The drive list consists of an array of 26 bytes. Array index zero corresponds to drive A, index one equals B etc.

Each byte with a non zero value signifies that the corresponding drive is available to the system. In the case of removable media, RFs::Drive should be used to determine whether the media is inserted or not.

The local file system always reserves drive letters A through I. Drive letter Z is always used for the ROM which means that letters J through Y are available to be used by SetSubst() or for redirecting.

Parameters
aListOn return, contains a list of drive attributes (only the first 8 bits) for the available non-remote and non-hidden drives.
Return Value
KErrNone, successful, otherwise one of the other system-wide error codes.

DriveList ( TDriveList &, TUint )

IMPORT_C TIntDriveList(TDriveList &aList,
TUintaFlags
)const

Gets a list of the available drives that match a combination of drive attributes,specified in aFlags. This combination may include,exclude or exclusively specify the attributes that that drives to be returned should match.

The drive list consists of an array of 26 bytes. Array index zero corresponds to drive A, index one equals B etc.

Each byte with a non zero value signifies that the corresponding drive is available to the system. In the case of removable media, RFs::Drive should be used to determine whether the media is inserted or not.

The local file system always reserves drive letters A through I. Drive letter Z is always used for the ROM which means that letters J through Y are available to be used by SetSubst() or for redirecting.

Parameters
aListOn return, contains a list of available drives that qualify aFlags.
aFlagsA combination of drive attributes that drives to be returned must qualify.
Return Value
KErrNone, successful, otherwise one of the other system-wide error codes; KErrArgument, If aFlags contains an invalid attribute combination.

DriveToChar ( TInt, TChar & )

IMPORT_C TIntDriveToChar(TIntaDrive,
TChar &aChar
)[static]

Maps a drive number to the corresponding character.

The drive number must be in the range 0 to (KMaxDrives-1). For example, drive number zero (EDriveA) corresponds to drive A, one (EDriveB) corresponds to drive B. For the drive number enumeration, see TDriveNumber.

The drive number can also be KDefaultDrive, implying the default drive. In this case the current drive is taken and converted.

Parameters
aDriveThe drive number.
aCharOn return, contains the drive character.
Return Value
KErrNone, if successful; KErrArgument, if the drive number is invalid; otherwise one of the other system-wide error codes.

Entry ( const TDesC &, TEntry & )

IMPORT_C TIntEntry(const TDesC &aName,
TEntry &anEntry
)const

Gets the entry details for a file or directory.

This information includes UID information.

Parameters
aNameName of file or directory.
anEntryOn return, contains the entry details for the file or directory. TEntry::iModified contains UTC date and time.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.
Capability
DependentIf 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.
DependentIf 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.

ErasePassword ( TInt )

IMPORT_C TIntErasePassword(TIntaDrv)

Erase the password from the locked MultiMedia card in the specified drive.

Used when the password is unknown, and may result in the media being erased.

Successful execution of this call may result in leaving the media in unformatted state. Hence, it is recommended to format the Multimedia card after calling RFs::ErasePassword().

Parameters
aDrvThe drive.
Return Value
KErrNone, if successful; otherwise one of the other system-wide error codes.
Capability
DiskAdmin

ExtensionName ( TDes &, TInt, TInt )

IMPORT_C TIntExtensionName(TDes &aExtensionName,
TIntaDrive,
TIntaPos
)

Gets the name of the extension on the specified drive at the specified position in the extension hierarchy.

Parameters
aExtensionNameOn successful return, contains the name of the extension.
aDriveThe drive for which the extension name is required.
aPosThe position of the extension in the extension hierarchy.
Return Value
KErrNone, if successful; KErrNotFound if the extension name is not found;

FileSystemName ( TDes &, TInt )

IMPORT_C TIntFileSystemName(TDes &aName,
TIntaDrive
)const

Gets the name of the file system mounted on the specified drive. The function can be called before calling DismountFileSystem().

Note that the file system name, returned in the aName descriptor shall be threated as case-insensitive string. I.e. "fileSystem" and "FILESYSTEM" mean absolutely the same. Therefore, case-insensitive string methods (like TDesC::FindF(), TDesC::CompareF()) shall be used to deal with the file system names.

See also: RFs::DismountFileSystem

Parameters
aNameOn successful return, contains the name of the file system.
aDriveThe drive for which the file system name is required.
Return Value
KErrNone, if successful; KErrNotFound if aFileSystemName is not found, or the drive does not have a file system mounted on it; KErrArgument, if the drive value is outside the valid range, i.e. zero to KMaxDrives-1 inclusive.

FileSystemSubType ( TInt, TDes & )

IMPORT_C TIntFileSystemSubType(TIntaDriveNo,
TDes &aName
)const

This function queries the sub type of the file system mounted on the specified volume. For example, 'FAT16' of the Fat file system. TFSName is recommended as the type for aName when using this function.

NOTE: For the file systems without a sub type (e.g. ROM file system), the the file system name is returned (For example, 'Rom'). Examples: "FAT" file system; the subtypes can be "fat12", "fat16" or "fat32" "ROFS" file system; the subtype will be "ROFS"

Note also that the file system name, returned in the aName descriptor shall be threated as case-insensitive string. I.e. "fileSystem" and "FILESYSTEM" mean absolutely the same. Therefore, case-insensitive string methods (like TDesC::FindF(), TDesC::CompareF()) shall be used to deal with the names.

See also: TFSName

Parameters
aDriveNodrive number, specifies which volume to query.
aNamedescriptor containing the returned sub type name or file system name.
Return Value
KErrNone if successful; KErrNotSuppoted if sub type is not supported; otherwise another system-wide error code is returned.

FinaliseDrive ( TInt, TFinaliseDrvMode )

IMPORT_C TIntFinaliseDrive(TIntaDriveNo,
TFinaliseDrvModeaMode
)const

Finalise the given drive. This operation is intended to put the drive into the consistent state when it is safe to remove it physically or switch the power off.

Parameters
aDriveNodrive number
aModedescribes the finalisation operation, see RFs::TFinaliseDrvMode enum
Return Value
KErrNone on success, KErrArgument if the function arguments are invalid KErrInUse if the drive has opened disk access objects (format, raw disk access, etc) and therefore can not be finalised KErrCorrupt if the drive is corrupt. System wide error codes otherwise.
Capability
DiskAdmin

FinaliseDrives ( )

IMPORT_C TIntFinaliseDrives()

Makes the best effort to finalise all drives in the system. Effectively calls RFs::FinaliseDrive(..., EFinal_RW) to all present drives in the system. This makes impossible to analyse the error code if the finalisation of some fails. It is much better to use RFs::FinaliseDrive(...) specifying concrete drive number and desired finalisation mode.

Return Value
KErrNone, if successful; otherwise one of the other system-wide error codes.
Capability
DiskAdmin

GetDir ( const TDesC &, TUint, TUint, CDir *& )

IMPORT_C TIntGetDir(const TDesC &aName,
TUintanEntryAttMask,
TUintanEntrySortKey,
CDir *&anEntryList
)const

Gets a filtered list of a directory's contents.

The bitmask determines which file and directory entry types should be listed. The sort key determines the order in which they are listed.

Notes:

1. If sorting by UID (as indicated when the ESortByUid bit is OR'ed with the sort key), then UID information will be included in the listing whether or not KEntryAttAllowUid is specified in anAttMask.

2. The function sets aFileList to NULL, and then allocates memory for it before appending entries to the list. Therefore, aFileList should have no memory allocated to it before this function is called, otherwise this memory will become orphaned.

3. The caller of this function is responsible for deleting aFileList after the function has returned.

See also: TEntryKey

Parameters
aNameThe name of the directory for which a listing is required. Wildcards may be used to specify particular files.
anEntryAttMaskBitmask indicating the attributes of interest. Only files and directories whose attributes match those specified here can be included in the listing. For more information, see KEntryAttMatchMask and the other directory entry details. Also see KEntryAttNormal and the other file or directory attributes.
anEntrySortKeyThe sort key. This is a set of flags indicating the order in which the entries are to be sorted. These flags are defined by TEntryKey.
anEntryListOn return contains a filtered list of directory and file entries.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.

GetDir ( const TDesC &, TUint, TUint, CDir *&, CDir *& )

IMPORT_C TIntGetDir(const TDesC &aName,
TUintanEntryAttMask,
TUintanEntrySortKey,
CDir *&anEntryList,
CDir *&aDirList
)const

Gets a filtered list of the directory and file entries contained in a directory, and a list of the directory entries only.

The bitmask determines which file and directory entry types should be listed in aFileList. The contents of the second list, aDirList are not affected by the bitmask; it returns all directory entries contained in directory aName. The sort key determines the order in which both lists are sorted.

Notes:

1. If sorting by UID (as indicated when the ESortByUid bit is OR'ed with the sort key), then UID information will be included in the listing whether or not KEntryAttAllowUid is specified in anAttMask.

2. The function sets both aFileList and aDirList to NULL, and then allocates memory to them before appending entries to the lists. Therefore, aFileList and aDirList should have no memory allocated to them before this function is called, otherwise the allocated memory will become orphaned.

3. The caller of this function is responsible for deleting aFileList and aDirList after the function has returned.

See also: TEntryKey

Parameters
aNameThe name of the directory for which a listing is required. Wildcards may be used to specify particular files.
anEntryAttMaskBitmask indicating the attributes of interest. Only files and directories whose attributes match those specified here can be included in aFileList. aDirList is unaffected by this mask. For more information, see KEntryAttMatchMask and the other directory entry details. Also see KEntryAttNormal and the other file or directory attributes.
anEntrySortKeyThe sort key. This is a set of flags indicating the order in which the entries in both lists are to be sorted. These flags are defined by TEntryKey.
anEntryListOn return contains a filtered list of directory and file entries.
aDirListOn return contains a filtered list of directory entries only.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.

GetDir ( const TDesC &, const TUidType &, TUint, CDir *& )

IMPORT_C TIntGetDir(const TDesC &aName,
const TUidType &anEntryUid,
TUintanEntrySortKey,
CDir *&aFileList
)const

Gets a filtered list of a directory's contents by UID type.

The aUidType parameter determines which file entry types should be listed. The sort key determines the order in which they are listed.

Notes:

1. The function sets aFileList to NULL, and then allocates memory for it before appending entries to the list. Therefore, aFileList should have no memory allocated to it before this function is called, otherwise this memory will become orphaned.

2. The caller of this function is responsible for deleting aFileList after the function has returned.

See also: TEntryKey

Parameters
aNameThe name of the directory for which a listing is required. Wildcards may be used to specify particular files.
anEntryUidOnly those files whose UIDs match those specified within this UID type will be included in the file list. Any, or all, of the three UIDs within the UID type may be omitted. Any UID which is omitted acts in a similar manner to a wildcard character, matching to all UIDs.
anEntrySortKeyThe sort key. This is a set of flags indicating the order in which the entries are to be sorted. These flags are defined by TEntryKey.
aFileListOn return contains a filtered list of directory and file entries.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.

GetDriveName ( TInt, TDes & )

IMPORT_C TIntGetDriveName(TIntaDrive,
TDes &aDriveName
)const

Gets the name of a drive.

Drive naming is optional. If the drive specified has not been assigned a name, this function returns a descriptor whose length is zero.

See also: TDriveNumber

Parameters
aDriveThe drive number. Specify a drive in the range EDriveA to EDriveZ for drives A to Z, respectively. The default drive is the session default drive represented by KDefaultDrive.
aDriveNameOn return, the drive name.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.

GetLongName ( const TDesC &, TDes & )

IMPORT_C TIntGetLongName(const TDesC &aShortName,
TDes &aLongName
)const

Gets the long filename associated with a short (8.3) filename.

A long filename has a limit of 256 characters for each component, as well as a limit of 256 characters for the entire path.

Parameters
aShortNameThe short file name. Any path components which are not specified here will be taken from the session path. If the path specifies a directory, it may or may not be followed by a trailing backslash.
aLongNameOn return, contains the long version of the name.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.
Capability
DependentIf the path for aShortName starts with /Sys capability AllFiles is required
DependentIf the path for aShortName starts with /Private and this process does not have the relevant SID capability AllFiles is required

GetMediaSerialNumber ( TMediaSerialNumber &, TInt )

IMPORT_C TIntGetMediaSerialNumber(TMediaSerialNumber &aSerialNum,
TIntaDrive
)

Gets the serial number of media.

Only local drive is allowed. Substed drive number will return KErrNotSupported.

See also: TMediaSerialNumber

Parameters
aSerialNumContains serial number on successful return.
aDriveDrive number.
Return Value
KErrNone if successful; KErrNotSupported if media doesn't support serial number (e.g. substed drives); KErrBadName if drive number is invalid; otherwise one of system-wide error codes.

GetNotifyUser ( )

IMPORT_C TBoolGetNotifyUser()

Tests whether user notification of file read or write failure is in effect.

Return Value
True if notification in effect, false if not.

GetReserveAccess ( TInt )

IMPORT_C TIntGetReserveAccess(TIntaDriveNo)

Get exclusive access for this session to overwrite a specific disk area, which has previously been reserved via RFs::ReserveDriveSpace

Parameters
aDriveNodrive on which to get reserved access
Return Value
KErrNone if successful KErrPermissionDenied if the drive has no spare reserved space

GetShortName ( const TDesC &, TDes & )

IMPORT_C TIntGetShortName(const TDesC &aLongName,
TDes &aShortName
)const

Gets the short filename associated with a VFAT long filename.

The short filename has a limit of eight characters for the file name and three characters for the extension.

Parameters
aLongNameThe long filename. Any path components which are not specified here will be taken from the session path. If the path specifies a directory, it may or may not be followed by a trailing backslash.
aShortNameOn return, contains the short filename associated with the file or directory specified in aLongName.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.
Capability
DependentIf the path for aLongName starts with /Sys capability AllFiles is required
DependentIf the path for aLongName starts with /Private and this process does not have the relevant SID capability AllFiles is required

GetSystemDrive ( )

IMPORT_C TDriveNumberGetSystemDrive()[static]

Obtain the system drive number.

The System Drive is a defined drive on the device which is:
  • Read/Writeable

  • Internal: Always available and not removable from the device

  • Non-Volatile (e.g. Flash memory, battery-backed RAM)

  • Only Accessible via Rfs (e.g. not available via USB mass storage)

The System drive is utilised as:
  • Storage for Persistent settings from system and application software

  • Storage for Localisation resources

  • A Default Drive for user data

  • A Target Drive for Software installations

It the system drive is not set previously (see RFs::SetSystemDrive) EDriveC is returned by default.

See also: RFs::GetSystemDriveChar RFs::SetSystemDrive TDriveNumber

Return Value
TDriveNumber contains the drive number of the system drive.

GetSystemDriveChar ( )

IMPORT_C TCharGetSystemDriveChar()[static]

This is a wrapper around GetSystemDrive() function. It returns the character corresponding to the system drive.

See also: RFs::GetSystemDrive

Return Value
The system drive character

InitialisePropertiesFile ( const TPtrC8 & )

IMPORT_C TIntInitialisePropertiesFile(const TPtrC8 &aPtr)const

Sets the F32 properties file - Can only be called from the ESTART process

Parameters
aPtrA descriptor pointing to an INI file in ROM.
Return Value
KErrNone if successful.
Capability
KDiskAdmin

IsFileInRom ( const TDesC & )

IMPORT_C TUint8 *IsFileInRom(const TDesC &aFileName)const

Gets a pointer to the specified file, if it is in ROM.

Note that this is not a test of whether the file is on the Z: drive, as the Z: drive may consist of a ROM and another file system, using the composite file system. For example, the file system may be ROFS, and the underlying media NAND flash.

Parameters
aFileNameThe filename whose address is sought. Cannot include wildcards. Any path components which are not specified here will be taken from the session path.
Return Value
Address of the start of the file, if it is in ROM. This is NULL, if the file is not in ROM. Note that for the composite file system, the file might be on the Z: drive but in a non-ROM file system (i.e. ROFS), in which case the function still returns NULL.
Capability
DependentIf the path for aFileName starts with /Sys capability AllFiles is required
DependentIf the path for aFileName starts with /Private and this process does not have the relevant SID capability AllFiles is required

IsFileOpen ( const TDesC &, TBool & )

IMPORT_C TIntIsFileOpen(const TDesC &aFile,
TBool &anAnswer
)const

Tests whether a file is open.

This function is useful because several file based operations provided by the RFs class, for example: Delete(), Replace() and Rename(), require that the file be closed.

See also: RFs::Delete RFs::Rename RFs::Replace

Parameters
aFileThe name of the file to test. Any path components which are not specified here will be taken from the session path. If a directory is specified instead of a file then KErrNone will be returned and anAnswer will be set to EFalse.
anAnswerOn return, true if the file is open, false if closed.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.
Capability
DependentIf the path for aFileName starts with /Sys capability AllFiles is required
DependentIf the path for aFileName starts with /Private and this process does not have the relevant SID capability AllFiles is required

IsRomAddress ( TAny * )

IMPORT_C TBoolIsRomAddress(TAny *aAny)[static]

Tests whether the specified address is in ROM.

Parameters
aAnyThe address.
Return Value
True, if the address is in ROM; false, if not.

IsValidDrive ( TInt )

IMPORT_C TBoolIsValidDrive(TIntaDrive)[static]

Tests whether the specified drive number is valid.

A valid drive number is any number between 0 and (KMaxDrives-1) inclusive, or the specific value KDefaultDrive (implying the session default drive).

See also: TDriveNumber

Parameters
aDriveThe drive number.
Return Value
True if the drive is valid; false if not.

IsValidName ( const TDesC & )

IMPORT_C TBoolIsValidName(const TDesC &anEntryName)const

Tests whether a filename and path are syntactically correct.

The following restrictions apply to the path and to its components:

1. Wildcards are not allowed in any path component, including the filename and extension. 2. Double backslashes are not allowed anywhere in the path 3. The following 6 characters cannot appear in the path: < > : " / | 4. Either or both of a filename or extension must be present. This means that a valid aFileName can not end with backslash (like "c:\\SomeName\\"), because it will mean that "SomeName" is a directory.

5. The entire component following the final backslash (the filename and extension) cannot consist solely of space characters, or of a single or double dot.

6. Spaces between the drive, if specified, and the first directory in the path are illegal, although there may be spaces between other path components, for example, between directories.

7. If the path in aFileName is not fully specified, i.e. doesn't look like "c:\\Dir1\\File1.bin", all missing parts of the full path will be taken from the session path,

See also: RFs::SetSessionPath, RFs::SessionPath. In this case the session path must be set, otherwise this method will return EFalse. For example: for the case "\\file1.txt" only the drive letter will be taken from the session path; for the case "file1.txt" whole session path will be internally prepended to the "file1.txt" and whole path checked. Note that in this case total length of the name in the aFileName parameter and the session path shall not exceed KMaxFileName characters.

Parameters
anEntryNameThe path to be checked for validity. May specify a filename alone, or an entire path specification, including drive letter. If a path is specified, all components are checked for validity.
Return Value
ETrue, if the name is valid (conforms to the mentioned above criteria); EFalse otherwise.

IsValidName ( const TDesC &, TText & )

IMPORT_C TBoolIsValidName(const TDesC &aFileName,
TText &aBadChar
)const

The following restrictions apply to the path and to its components:

1. Wildcards are not allowed in any path component, including the filename and extension. 2. Double backslashes are not allowed anywhere in the path 3. The following 6 characters cannot appear in the path: < > : " / | 4. Either or both of a filename or extension must be present. This means that a valid aFileName can not end with backslash (like "c:\\SomeName\\"), because it will mean that "SomeName" is a directory.

5. The entire component following the final backslash (the filename and extension) cannot consist solely of space characters, or of a single or double dot.

6. Spaces between the drive, if specified, and the first directory in the path are illegal, although there may be spaces between other path components, for example, between directories.

7. If the path in aFileName is not fully specified, i.e. doesn't look like "c:\\Dir1\\File1.bin", all missing parts of the full path will be taken from the session path,

See also: RFs::SetSessionPath, RFs::SessionPath. In this case the session path must be set, otherwise this method will return EFalse. For example: for the case "\\file1.txt" only the drive letter will be taken from the session path; for the case "file1.txt" whole session path will be internally prepended to the "file1.txt" and whole path checked. Note that in this case total length of the name in the aFileName parameter and the session path shall not exceed KMaxFileName characters.

Parameters
aFileNameThe path to be checked for validity. May specify a filename alone, or an entire path specification, including drive letter. If a path is specified, all components are checked for validity.
aBadCharreference to the variable that on return can contain illegal character from aFileName. 1. if the filename and optional path in aFileName are valid, this method will return ETrue and aBadChar will be set to 0x00. 2. if there is an illegal character in aFileName, this method will return EFalse and aBadChar will contain this illegal character. 3. if there is no illegal characters in aFileName, but this is still not a valid filename (like "\\SomeName\\") this method will return EFalse and aBadChar will contain space ' ' or code 0x20.
Return Value
ETrue, if the name is valid (conforms to the mentioned above criteria); EFalse otherwise.

IsValidName ( const TDesC &, TNameValidParam & )

IMPORT_C TBoolIsValidName(const TDesC &aName,
TNameValidParam &aParam
)

This API can be used to validate both directory and file names. If the name ends with a trailing backslash '\' then it is considered to be a directory else a filename. For example: "C:\\test\\" would mean a directory, whereas "C:\\test" would mean a file, both of which would be returned as a Valid Name. However a name such as "C:\\test\\\\" would be returned as an Invalid name with error code TError::ErrBadName

The following restrictions apply to the path and to its components:

1. Wildcards are not allowed in any path component, including the name and extension. 2. Double backslashes are not allowed anywhere in the path 3. The following 6 characters cannot appear in the path: < > : " / | 4. The entire component following the final backslash (the filename and extension) cannot consist solely of space characters, or of a single or double dot. 5. Spaces between the drive, if specified, and the first directory in the path are illegal, although there may be spaces between other path components, for example, between directories. 6. If TNameValidParam::iUseSesssionPath is set to ETrue, and if the path in aName is not fully specified, i.e. doesn't look like "c:\\Dir1\\File1.bin", all missing parts of the full path will be taken from the session path,

See also: RFs::SetSessionPath, RFs::SessionPath. In this case the session path must be set, otherwise this method will return EFalse. For example: for the case "\\file1.txt" only the drive letter will be taken from the session path; for the case "file1.txt" whole session path will be internally prepended to the "file1.txt" and whole path checked. Note that in this case total length of the name in the aName parameter and the session path shall not exceed KMaxFileName characters. 7. If TNameValidParam::iUseSesssionPath is set to EFalse, which is the default value, then the session path is not used to fill in the missing parts of the name as stated above. For example: for the case "file1.txt", session path will not be used to check the validity of the name.

Parameters
aNameThe path to be checked for validity. May specify a name alone, or an entire path specification, including drive letter. If a path is specified, all components are checked for validity.
aParamreference to the variable that on return can contain details of the error if any. While constructing an object of this type one could specify whether one wants to use the sessionPath for filling up missing parts of aName, or one would want to test aName as it is without prepending the sessionPath. By default the sessionPath is NOT used. 1. if the name and optional path in aName are valid, this method will return ETrue and TError::iError will contain ErrNone. 2. if there is an illegal character in aName, this method will return EFalse and TError::iError will contain KErrBadCharacter. Also TError::iInvalidCharPos will indicate the position of the rightmost invalid character. 3. if there is no illegal characters in aName, but this is still not a valid name (like "") this method will return EFalse and TError::iError will contain KErrBadCharacter, while iInvalidCharPos will be set to 0 4. if length of the name exceeds 256 characters, this method will return EFalse and TError::iError will contain KErrTooLong. if the optional sessionPath is used, then the length of the sessionPath is also used to determine whether the length exceeds 256 characters.
Return Value
ETrue, if the name is valid (conforms to the mentioned above criteria); EFalse otherwise.

LoaderHeapFunction ( TInt, TAny *, TAny * )

IMPORT_C TIntLoaderHeapFunction(TIntaFunction,
TAny *aArg1 = NULL,
TAny *aArg2 = NULL
)

This member function is not implemented in this version of Symbian OS. It always returns KErrNotSupported.

Return Value
KErrNotSupported is returned always.

LockDrive ( TInt, const TMediaPassword &, const TMediaPassword &, TBool )

IMPORT_C TIntLockDrive(TIntaDrv,
const TMediaPassword &aOld,
const TMediaPassword &aNew,
TBoolaStr
)

Sets the password for the media in the specified drive.

The media is not necessarily locked afterwards. Accessibility is determined by the following rules:

  • The media may not become locked until power is removed (such as with MMC cards)

  • If the password is added to the password store (the aStore parameter is ETrue), the media will be automatically unlocked on the next access.

Parameters
aDrvThe drive.
aOldThe existing password. If no password is set, this must be a zero-length descriptor.
aNewThe new password.
aStrETrue if the new password is to be saved to the controller password store; EFalse if not.
Return Value
KErrNone if successful; KErrNotSupported if the media does not support password locking.
Capability
DiskAdmin

MkDir ( const TDesC & )

IMPORT_C TIntMkDir(const TDesC &aPath)

Makes a directory.

It should be a sub-directory of an existing directory and its name should be unique within its parent directory, otherwise the function returns error code KErrAlreadyExists.

Note that if a filename is specified in the argument, it is ignored. Therefore, there should be a trailing backslash after the final directory name in the argument to indicate that it is a directory, not a filename.

For example, following code will create directory "C:\\DIR1\\"

fs.MkDir(_L("C:\\DIR1\\"));

The last line in the following example will result in KErrAlreadyExists because "DIR2" doesn't have a trailing backslash, therefore is considered as a file name and discarded. Directory "C:\\DIR1\\" has already been created.

fs.MkDir(_L("C:\\DIR1\\"));     // shall create DIR1 in the root directory
fs.MkDir(_L("C:\\DIR1\\DIR2")); // No trailing backslash, fails with KErrAlreadyExists

This example will always fail because "DIR1" doesn't have a trailing backslash and discarded while the root directory always exists.

fs.MkDir(_L("C:\\DIR1"));  // No trailing backslash, will always fail with KErrAlreadyExists

Note, the following case

fs.MkDir(_L("C:\\example.txt\\"));	// would normally create a directory "c:\\example.txt\\" with KErrNone

But if there is a file named "example.txt", which exists at the same location, KErrAccessDenied is returned.

Note also that because this method can return an error code (eg. because the disk is full) before checking whether the path already exists, it is not appropriate to use it just to work out whether a path exists or not.

See MkDirAll(), which may also create intermediate directories.

See also: RFs::MkDirAll

Parameters
aPathThe name of the new directory. Any path components which are not specified here will be taken from the session path. The directory name shall not contain wild cards ('?' or '*' characters) and illegal characters like '<', '>', ':', '"', '/', '|' and '\000'. The directory name containing only white space characters (See TChar::IsSpace()) is also illegal.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes. Even if another error code is returned, (for example, if the disk is full) it is still possible that the path may already exist.
Capability
DependentIf aPath is /Sys then Tcb capability is required.
DependentIf aPath begins with /Private and does not match this process' SID then AllFiles capability is required.
DependentIf aPath is /Resource then Tcb capability is required.

MkDirAll ( const TDesC & )

IMPORT_C TIntMkDirAll(const TDesC &aPath)

Makes one or more directories.

Any valid path component specified in aPath which does not already exist is created as a directory.

Note that if a filename is specified in the argument, it is ignored. Therefore, there should be a trailing backslash after the final directory name in the argument to indicate that it is a directory, not a filename.

See also notes on RFs::MkDir() about trailing backslashes in directory names.

Note also that because this method can return an error code (eg. because the disk is full) before checking whether the path already exists, it is not appropriate to use it just to work out whether a path exists or not.

See MkDir(), which creates only a single new directory.

See also: RFs::MkDir

Parameters
aPathThe path name specifiying the directory or directories to create. If the function completes successfully, this path identifies a valid directory. Any path components which are not specified here are taken from the session path.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes. Even if another error code is returned, (for example, if the disk is full) it is still possible that the path may already exist.
Capability
DependentIf aPath is /Sys then Tcb capability is required.
DependentIf aPath begins with /Private and does not match this process' SID then AllFiles capability is required.
DependentIf aPath is /Resource then Tcb capability is required.

Modified ( const TDesC &, TTime & )

IMPORT_C TIntModified(const TDesC &aName,
TTime &aTime
)const

Gets the last modification date and time of a file or a directory, in UTC.

If there has been no modification, the function gets the date and time of the file or directory's creation.

Parameters
aNameFile or directory name.
aTimeOn return, contains the date and time of the file or directory's last modification in universal time.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.
Capability
DependentIf aName contains /sys/ then AllFiles capability is required.
DependentIf aName contains /Private/ and does not match this process' SID then AllFiles capability is required.

MountExtension ( const TDesC &, TInt )

IMPORT_C TIntMountExtension(const TDesC &aExtensionName,
TIntaDrive
)

Mounts the the specified extension.

The extension must first have been loaded using AddExtension().

See also: RFs::ExtensionName

Parameters
aExtensionNameThe fullname of the extension, as returned from a call to ExtensionName(). The extension names have the same conventions as file system names i.e. case-insensitive and no longer than KMaxFSNameLength.
aDriveThe drive on which the extension is to be mounted;
Return Value
KErrNone if successful; KErrNotFound, if the extension cannot be found; otherwise one of the other system-wide error codes.

MountFileSystem ( const TDesC &, TInt )

IMPORT_C TIntMountFileSystem(const TDesC &aFileSystemName,
TIntaDrive
)const

Mounts a file system on a drive. The file system must first have been added to the file server using AddFileSystem(). The drive is mounted as asynchronous, i.e operations on it don't block the file server and other drives;

otherwise one of the other system-wide error codes.

See also: RFs::AddFileSystem RFs::FileSystemName

Parameters
aFileSystemNameThe name the file system, like "FAT". Note that this is _not_ the name of the plugin (*.fsy). The file system name is case-insensitive, i.e. "FAT", "fat", "Fat" are equivalent. The maximum lentgth of the file name is KMaxFSNameLength.
aDriveThe drive number on which the file system is to be mounted; this can be one of the values defined by TDriveNumber.
Return Value
KErrNone if successful KErrLocked if the media is locked KErrCorrupt most likely means that the data structures on the media are not recognized by the given file system. This usually happens when the medium is damaged, unformatted, formatted with a different file system or vital file system structures are corrupted.
Capability
DiskAdmin

MountFileSystem ( const TDesC &, TInt, TBool )

IMPORT_C TIntMountFileSystem(const TDesC &aFileSystemName,
TIntaDrive,
TBoolaIsSync
)const

Mounts a file system on a drive. The file system must first have been added to the file server using AddFileSystem(). Depending on the aIsSync parameter, the drive can be mounted as synchronous or asynchronous.

Asynchronous drive has its own processing thread, i.e operations on it don't block the file server and other drives; Synchronous drives' requests are being processed by the main file server thread and there is a possibility to block it along with all operations on other drives. Mounting a drive as synch. makes a sense if the operations on such drive are very fast e.g. this is an internal RAM or ROFS drive.

See also: RFs::AddFileSystem RFs::FileSystemName

Parameters
aFileSystemNameThe name the file system, like "FAT". Note that this is _not_ the name of the plugin (*.fsy). The file system name is case-insensitive, i.e. "FAT", "fat", "Fat" are equivalent. The maximum lentgth of the file name is KMaxFSNameLength.
aDriveThe drive number on which the file system is to be mounted; this can be one of the values defined by TDriveNumber.
aIsSyncif ETrue the drive will be mounted as synchronous one; if EFalse the drive will be mounted as Asynchronous.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.
Capability
DiskAdmin

MountFileSystem ( const TDesC &, const TDesC &, TInt )

IMPORT_C TIntMountFileSystem(const TDesC &aFileSystemName,
const TDesC &aExtensionName,
TIntaDrive
)

Mounts a file system on a drive, along with the specified primary drive extension.

The file system must first have been added to the file server using AddFileSystem(). The extension must first have been added to the file server using AddExtension(). The drive is mounted as asynchronous, i.e operations on it don't block the file server and other drives;

See also: RFs::AddFileSystem RFs::FileSystemName

Parameters
aFileSystemNameThe name the file system, like "FAT". Note that this is _not_ the name of the plugin (*.fsy). The file system name is case-insensitive, i.e. "FAT", "fat", "Fat" are equivalent. The maximum lentgth of the file name is KMaxFSNameLength.
aExtensionNameThe name of the primary drive extension. It has the same conventions as the aFileSystemName.
aDriveThe drive on which the file system is to be mounted; this can be one of the values defined by TDriveNumber.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.
Capability
DiskAdmin

MountFileSystem ( const TDesC &, const TDesC &, TInt, TBool )

IMPORT_C TIntMountFileSystem(const TDesC &aFileSystemName,
const TDesC &aExtensionName,
TIntaDrive,
TBoolaIsSync
)

Mounts a file system on a drive, along with the specified primary drive extension.

The file system must first have been added to the file server using AddFileSystem(). The extension must first have been added to the file server using AddExtension(). Depending on the aIsSync parameter, the drive can be mounted as synchronous or asynchronous.

See also: RFs::AddFileSystem RFs::FileSystemName

Parameters
aFileSystemNameThe name the file system, like "FAT". Note that this is _not_ the name of the plugin (*.fsy). The file system name is case-insensitive, i.e. "FAT", "fat", "Fat" are equivalent. The maximum lentgth of the file name is KMaxFSNameLength.
aExtensionNameThe name of the primary drive extension. It has the same conventions as the aFileSystemName.
aDriveThe drive on which the file system is to be mounted; this can be one of the values defined by TDriveNumber.
aIsSyncif ETrue the drive will be mounted as synchronous one; if EFalse the drive will be mounted as Asynchronous.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.
Capability
DiskAdmin

MountFileSystemAndScan ( const TDesC &, TInt, TBool & )

IMPORT_C TIntMountFileSystemAndScan(const TDesC &aFileSystemName,
TIntaDrive,
TBool &aIsMountSuccess
)const

Mounts a file system on a drive, and performs a scan on that drive by calling RFs::ScanDrive. The file system must first have been added to the file server using AddFileSystem(). Note that the scan is done only if the mount is successful.

The drive is mounted as asynchronous, i.e operations on it don't block the file server and other drives;

See also: RFs::ScanDrive RFs::TDriveNumber RFs::AddFileSystem RFs::FileSystemName

Parameters
aFileSystemNameThe name the file system, like "FAT". Note that this is _not_ the name of the plugin (*.fsy). The file system name is case-insensitive, i.e. "FAT", "fat", "Fat" are equivalent. The maximum lentgth of the file name is KMaxFSNameLength.
aDriveThe drive on which the file system is to be mounted; this can be one of the values defined by TDriveNumber.
aIsMountSuccessOn return, set to: ETrue, if the if the mount is successful, set to EFalse otherwise.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes, reflecting the failure of the mount operation.
Capability
DiskAdmin

MountFileSystemAndScan ( const TDesC &, const TDesC &, TInt, TBool & )

IMPORT_C TIntMountFileSystemAndScan(const TDesC &aFileSystemName,
const TDesC &aExtensionName,
TIntaDrive,
TBool &aIsMountSuccess
)const

Mounts a file system on a drive, along with the specified primary drive extension and performs a scan on that drive by calling RFs::ScanDrive.

The file system must first have been added to the file server using AddFileSystem(). The extension must first have been added to the file server using AddExtension(). Note that the scan is done only if the mount is successful. The drive is mounted as asynchronous, i.e operations on it don't block the file server and other drives.

Parameters
aFileSystemNameThe name the file system, like "FAT". Note that this is _not_ the name of the plugin (*.fsy). The file system name is case-insensitive, i.e. "FAT", "fat", "Fat" are equivalent. The maximum lentgth of the file name is KMaxFSNameLength.
aExtensionNameThe name of the primary drive extension. It has the same conventions as the aFileSystemName.
aDriveThe drive on which the file system is to be mounted; this can be one of the values defined by TDriveNumber.
aIsMountSuccessOn return, set to: ETrue, if the if the mount is successful, set to EFalse otherwise.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes, reflecting the failure of the mount operation.

MountPlugin ( const TDesC & )

IMPORT_C TIntMountPlugin(const TDesC &aPluginName)const

Mounts a specified plugin.

Note that this API uses unique position of the plugin.

This overload passes KPluginAutoAttach for the drive parameter which mounts on all of the drives specified as supported by the plugin.

Note - It is not possible for plugins to intercept read and write requests made on demand paged files. Therefore, to avoid possible drive corruption plugin modifier plugins cannot be mounted on drives with open demand paged files, i.e. drives with any open code paged executables and/or any open RFileMap objects. Conversely, demand paged files cannot be opened on drives that have modifier plugins mounted on it.

KErrNone is returned so long as it has been able to mount on at least one drive; otherwise KErrNotSupported.

See also: RFs::PluginName

Parameters
aPluginNameThe fullname of the plugin, as returned from a call to PluginName().
Return Value
KErrNone if successful; KErrNotFound, if the plugin cannot be found; otherwise one of the other system-wide error codes.
Capability
DiskAdmin

MountPlugin ( const TDesC &, TInt )

IMPORT_C TIntMountPlugin(const TDesC &aPluginName,
TIntaDrive
)const

Mounts a specified plugin specifying the drive plugin will support.

Plugins cannot be mounted on demand paged drives. If KPluginAutoAttach is passed in, it will return KErrNone so long as it has been able to mount on at least one drive; otherwise KErrNotSupported.

See also: RFs::PluginName

Parameters
aPluginNameThe fullname of the plugin, as returned from a call to PluginName().
aDriveIf the mounted plugin is a version2 plugin, then in order to mount on drive z, KPluginMountDriveZ should be passed as a parameter. For all other drive letters use values 0 to 24 for A to Y. Version1 plugins cannot mount on Z drive. To let the plugin decide on which drives to mount, use KPluginAutoAttach.
Return Value
KErrNone if successful; KErrNotFound, if the plugin cannot be found; otherwise one of the other system-wide error codes.
Capability
DiskAdmin

MountPlugin ( const TDesC &, TInt, TInt )

IMPORT_C TIntMountPlugin(const TDesC &aPluginName,
TIntaDrive,
TIntaPos
)const

Mounts a specified plugin using absolute position and a specific drive

Plugins cannot be mounted on demand paged drives. If KPluginAutoAttach is passed in, it will return KErrNone so long as it has been able to mount on at least one drive; otherwise KErrNotSupported.

Plugins wishing to be mounted using their CFsPlugin::iUniquePos should use MountPlugin(TDesC&,TInt) or MountPlugin(TDesC&)

If there is already a plugin at aPos then this plugin is inserted into aPos and other plugins are shifted downwards.

See also: RFs::PluginName RFs::MountPlugin(const TDesC& aPluginName,TInt aDrive)

Parameters
aPluginNameThe fullname of the plugin, as returned from a call to PluginName().
aDriveIf the mounted plugin is a version2 plugin, then in order to mount on drive z, KPluginMountDriveZ should be passed as a parameter. For all other drive letters use values 0 to 24 for A to Y. Version1 plugins cannot mount on Z drive. To let the plugin decide on which drives to mount, use KPluginAutoAttach.
aPosThe position at which the plugin is to be mounted within the internal array of plugins.
Return Value
KErrNone if successful; KErrNotFound, if the plugin cannot be found; otherwise one of the other system-wide error codes.
Capability
DiskAdmin

MountProxyDrive ( const TUint, const TDesC &, T0, T1 )

TInt MountProxyDrive(const TUintaDrive,
const TDesC &aName,
T0a0,
T1a1
)[inline]

NotifyChange ( TNotifyType, TRequestStatus & )

IMPORT_C voidNotifyChange(TNotifyTypeaType,
TRequestStatus &aStat
)

Requests a notification of change to files or directories.

Changes are notified either:

1. following any change in the file system

or

2. only following the addition or deletion of a directory entry, or after a disk has been formatted or changed.

Such notification is useful for programs that maintain displays of file lists which must be dynamically updated. The alternative is to do no updating, or to perform periodic monitoring for change, which is inefficient.

This is an asynchronous request and, as such, results in precisely one signal to the request status passed as a parameter. To avoid missing any change, this request should be issued before the first file list is constructed. When the request completes, a new request should be issued before the next file list is constructed. When the file server session is closed, this request is implicitly cancelled.

Call NotifyChangeCancel() to explicitly cancel a notification request.

Parameters
aTypeIndicates the kind of change that should result in notification. For example: ENotifyEntry causes notification only when an entry is added or deleted, or when a disk is formatted or changed; ENotifyAll causes notification following any type of change, such as when a file is written to, or when a file's attributes are changed.
aStatThe request status. This is set to KErrNone on completion, otherwise one of the other system-wide error codes.

NotifyChange ( TNotifyType, TRequestStatus &, const TDesC & )

IMPORT_C voidNotifyChange(TNotifyTypeaType,
TRequestStatus &aStat,
const TDesC &aPathName
)

Requests a notification of change to files or directories, allowing a directory/file path to be specified.

Changes are notified either:

1. following any change in the file system

or

2. only following the addition or deletion of a directory entry, or after a disk has been formatted or changed.

Such notification is useful for programs that maintain displays of file lists which must be dynamically updated. The alternative is to do no updating, or to perform periodic monitoring for change, which is inefficient.

This is an asynchronous request and, as such, results in precisely one signal to the request status passed as a parameter. To avoid missing any change, this request should be issued before the first file list is constructed. When the request completes, a new request should be issued before the next file list is constructed. When the file server session is closed, this request is implicitly cancelled.

Call NotifyChangeCancel() to explicitly cancel a notification request.

Parameters
aTypeIndicates the kind of change that should result in notification. For example: ENotifyEntry causes notification only when an entry is added or deleted, or when a disk is formatted or changed; ENotifyAll causes notification following any type of change, such as when a file is written to, or when a file's attributes are changed.
aStatThe request status. This is set to KErrNone on completion, otherwise one of the other system-wide error codes.
aPathNameThe directory or file for which notification is required. By specifying a drive as a wildcard, for example "?:\\Resource\\apps\\", or "*:\\Resource\\apps\\", a client can ask to be notified of changes to a given directory on any drive. As with all directory paths aPathName must be terminated with '\', Please refer to "Structure of paths and filenames" section in the Symbian OS Library.
Capability
DependentIf aName is /Sys then AllFiles capability is required.
DependentIf aName begins with /Private and does not match this process' SID then AllFiles capability is required.

NotifyChangeCancel ( )

IMPORT_C voidNotifyChangeCancel()

Cancels all outstanding requests for notification of change to files or directories.

All outstanding requests complete with KErrCancel.

Note that this is a synchronous function.

NotifyChangeCancel ( TRequestStatus & )

IMPORT_C voidNotifyChangeCancel(TRequestStatus &aStat)

Cancels the specific request for notification of change to files or directories.

The outstanding request completes with KErrCancel.

Note that this is an asynchronous function.

Parameters
aStatThe request status object associated with the request to be cancelled. Note that the function does not change this parameter.

NotifyDiskSpace ( TInt64, TInt, TRequestStatus & )

IMPORT_C voidNotifyDiskSpace(TInt64aThreshold,
TIntaDrive,
TRequestStatus &aStat
)

Requests notification when the free disk space on the specified drive crosses the specified threshold value.

The threshold is crossed if free disk space increases to a value above the threshold value or decreases to a value below the threshold value.

This is an asynchronous request that completes if any of the following events occur:

1. the threshold is crossed

2. any drive is formatted

3. there is a media change on any socket

4. power up

5. the scandrive utility is run on any drive

5. the specified threshold value is outside its limits

7. the outstanding request is cancelled.

Note that free disk space notification is not supported for drives using remote file systems.

See also: TDriveNumber

Parameters
aThresholdThe threshold value. This must be greater than zero and less than the total size of the disk.
aDriveThe drive number. This is an explicit drive defined by one of the TDriveNumber enum values or the value KDefaultDrive. If KDefaultDrive is specified, then the drive monitored is the session path drive.
aStatThe request status object. On request completion, contains: KErrNone, if the threshold value is crossed, if any drive is formatted, if there is a media change on any socket, if there is a power up or if the scandrive utility is run on any drive; KErrCancel, if the outstanding request is cancelled by a call to NotifyDiskSpaceCancel(); KErrArgument, if the threshold value is outside its limits.

NotifyDiskSpaceCancel ( TRequestStatus & )

IMPORT_C voidNotifyDiskSpaceCancel(TRequestStatus &aStat)

Cancels a specific outstanding request for free disk space notification.

The outstanding request completes with KErrCancel.

Parameters
aStatThe request status object identified with the original notification request.

NotifyDiskSpaceCancel ( )

IMPORT_C voidNotifyDiskSpaceCancel()

Cancels all outstanding requests for free disk space notification.

Outstanding requests complete with KErrCancel.

NotifyDismount ( TInt, TRequestStatus &, TNotifyDismountMode )

IMPORT_C voidNotifyDismount(TIntaDrive,
TRequestStatus &aStat,
TNotifyDismountModeaMode = EFsDismountRegisterClient
)const

Controls file system dismounting on the specified drive, the way of control depends on the parameter TNotifyDismountMode.

This API allows interested parties to: 1. Subscribe for notification of file system dismounting events. This allows subscribers to commit their data to the media prior to the file system being dismounted. See TNotifyDismountMode::EFsDismountRegisterClient

2. Make a graceful attempt to dismount the file system by notifying the subscribers about a pending file system dismount and waiting until all subscribers have finished processing the notification and have signaled that they are ready. If all clients don't respond in a reasonable time, the dismount request may be cancelled, followed by a forced dismount. If some client does not subscribe for dismounting notification and keeps handles opened, then after the file system dismounting all these handles will become invalid, any subsequent attempts to use them will result in KErrDismounted, and they should be closed(e.g. RFile::Close()). See TNotifyDismountMode::EFsDismountNotifyClients

3. Dismount the file system by force even if there are opened handles (files, directories) on the volume being dismounted. Any clients that kept handles opened, after forced file system dismounting will have them invalidated. And any further attempts to use these handles will result in KErrDismounted, and they should be closed(e.g. RFile::Close()). See TNotifyDismountMode::EFsDismountForceDismount

If there are clamped files on the volume, the file system dismounting will not happen until these files are unclamped.

The use case scenario: A 'Master' application that wants to dismount the file system on some drive 'aDrive' 'Client1' and 'Client2' applications interested in file system dismount event notifications, because they need to commit their data before the file system is dismounted.

1. 'Client1' and 'Client2' subscribe to the FS dismount notification using EFsDismountRegisterClient and start waiting on the request status objects. 2. 'Master' decides to dismount the file system on the drive 'aDrive'. 2.1 Graceful attempt: 'Master' calls RFs::NotifyDismount() with EFsDismountNotifyClients and starts waiting on 'aStat' for some time until all 'Client1' and 'Client2' respond or timeout occurs.

3. 'Client1' and 'Client2' have their 'aStat' completed as the result of the 'Master' calling EFsDismountNotifyClients. 3.1 'Client1' and 'Client2' flush data and close file handles. 3.2 as soon as 'Client1' and 'Client2' decide that they are ready for the pending FS dismount, they signal the 'Master' that they are ready by calling RFs::AllowDismount()

4. As soon as _all_ subscribed clients ('Client1' and 'Client2') have called RFs::AllowDismount(), the file system on drive 'aDrive' is dismounted and 'Master' has 'aStat' completed.

If, for example, 'Client2' hasn't responded in a reasonable time by calling RFs::AllowDismount(), the 'Master' can cancel the pending 'aStat' and dismount the file system by force by calling this API with EFsDismountForceDismount. In this case all subsequent attempts by 'Client2' to use its opened handles will result in KErrDismounted; these handles should be closed.

Parameters
aStatAsynchronous request state.
aModespecifies the behaviour of the notification API
Capability
DependentThe capabilities required to call this API are dependent upon the value of aMode passed to it. EFsDismountRegisterClient requires no capabilities; EFsDismountNotifyClients and EFsDismountForceDismount require DiskAdmin.

NotifyDismountCancel ( TRequestStatus & )

IMPORT_C voidNotifyDismountCancel(TRequestStatus &aStat)const

Cancels the oustanding dismount notifier, completing with KErrCancel.

See also: RFs::NotifyDismount

Parameters
aStatThe request status object associated with the request to be cancelled.

NotifyDismountCancel ( )

IMPORT_C voidNotifyDismountCancel()const

Cancels all oustanding dismount notifiers for this session, completing with KErrCancel.

See also: RFs::NotifyDismount

Parse ( const TDesC &, TParse & )

IMPORT_C TIntParse(const TDesC &aName,
TParse &aParse
)const

Parses a filename specification.

Parsing is done with wildcard resolution, using the session path as the default. You can then use TParse's getter functions to extract individual components of the resulting name. All the path components that are included in aName are put into the resulting filename. Any components that are still missing are taken from the session path.

Specifying:

TParse fp;
fs.Parse(name,fp);

is equivalent to

TParse fp;
fp.Set(name,NULL,&fs.SessionPath());

Note that the function does not check for illegal characters, or for illegal path components in either of the paths specified.

Parameters
aNameThe file name to be parsed, using the session path to provide the missing components.
aParseA TParse objct that provides functions for extracting individual components of the resulting file name.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.

Parse ( const TDesC &, const TDesC &, TParse & )

IMPORT_C TIntParse(const TDesC &aName,
const TDesC &aRelated,
TParse &aParse
)const

Parses a filename specification, specifying related file path components.

Parsing is done with wildcard resolution, using the session path as the default. You can then use TParse's getter functions to extract individual components of the resulting name. All the path components that are included in aName are put into the resulting filename. Any missing components are taken from the optional aRelated argument, which has the next order of precedence. Finally, any components that are still missing are taken from the session path.

Specifying:

TParse fp;
fs.Parse(name,related,fp);

is equivalent to

TParse fp;
fp.Set(name,related,&fs.SessionPath());

Note that the function does not check for illegal characters, or for illegal path components in any of the paths specified.

Parameters
aNameThe file name to be parsed, using the session path and the related path to provide the missing components.
aRelatedThe related file specification.
aParseA TParse objct that provides functions for extracting individual components of the resulting file name.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.

PluginName ( TDes &, TInt, TInt )

IMPORT_C TIntPluginName(TDes &aPluginName,
TIntaDrive,
TIntaPos
)

Gets the name of the plugin on the specified drive at the specified position in the plugin hierarchy.

Parameters
aPluginNameOn successful return, contains the name of the plugin.
aDriveThe drive for which the plugin name is required.
aPosThe position of the plugin in the plugin hierarchy.
Return Value
KErrNone, if successful; KErrNotFound if the plugin name is not found;

PrivatePath ( TDes & )

IMPORT_C TIntPrivatePath(TDes &aPath)

Creates the text defining the private path for a process.

The private path for a process has the form: \Private\13579BDF\ where 13579BDF is the identity of the process.

Parameters
aPathOn successful return, contains the private path for a process.

QueryVolumeInfoExt ( TInt, TQueryVolumeInfoExtCmd, TDes8 & )

IMPORT_C TIntQueryVolumeInfoExt(TIntaDrive,
TQueryVolumeInfoExtCmdaCommand,
TDes8 &aInfo
)const

Queries specific information on volumes by commands. Available commands is defined by TQueryVolumeInfoExtCmd.

See also: TQueryVolumeInfoExtCmd TVolumeIOParamInfo

Parameters
aCommandA command to specify which information is under query
aInfoA TPckgBuf<> to carry returned results.
Return Value
KErrNone if successful; otherwise another system-wide error code is returned.

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

IMPORT_C TIntReadFileSection(const TDesC &aName,
TInt64aPos,
TDes8 &aDes,
TIntaLength
)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.

Parameters
aNameName of the file to be accessed.
aPosThe offset, in bytes, from the start of the file where reading is to start.
aDesOn 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.
aLengthThe number of bytes to be read from the file.
Return Value
KErrNone if successful, KErrArgument if aLength is negative, otherwise one of the other system-wide error codes.
Panic Codes
FSCLIENT19 if aPos negative.
FSCLIENT27 if aLength is greater than the maximum length of the target descriptor.
Capability
DependentIf the path for aName starts with /Sys capability AllFiles is required
DependentIf the path for aName starts with /Private and this process does not have the relevant SID capability AllFiles is required

RealName ( const TDesC &, TDes & )

IMPORT_C TIntRealName(const TDesC &aName,
TDes &aResult
)const

Gets the real name of a file.

This is used in circumstances where a file system needs to mangle Symbian OS natural names so that it can store them on that file system.

Parameters
aNameContains the name by which the file is normally referred.
aResultOn return, contains the real name of the file, comprising the full path, including the drive letter.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.
Capability
DependentIf aName is /Sys then AllFiles capability is required.
DependentIf aName begins with /Private and does not match this process' SID then AllFiles capability is required.

ReleaseReserveAccess ( TInt )

IMPORT_C TIntReleaseReserveAccess(TIntaDriveNo)

Release exclusive access for this session to overwrite a specific disk area.

Parameters
aDriveNodrive on which to release reserved access
Return Value
KErrNone (always returned)

RemountDrive ( TInt, const TDesC8 *, TUint )

IMPORT_C TIntRemountDrive(TIntaDrive,
const TDesC8 *aMountInfo = NULL,
TUintaFlags = 0
)

Forces a remount of the specified drive.

Parameters
aDriveThe drive for which a remount is to be forced.
aMountInfoInformation passed down to the media driver. The meaning of this information depends on the media driver, for example, keys for secure areas.
aFlagsone of the flags specified in RFs::TForceMediaChangeFlags and describing the way drive is going to be remounted.
Return Value
KErrNone if successful, otherwise one of the other system wide error codes.

RemoveExtension ( const TDesC & )

IMPORT_C TIntRemoveExtension(const TDesC &aExtensionName)

Removes the specified extension.

Parameters
aExtensionNameThe fullname of the extension, as returned from a call to ExtensionName().
Return Value
KErrNone, if successful; KErrNotFound, if aExtensionName is not found; otrherwise one of the other system-wide error codes.

RemoveFileSystem ( const TDesC & )

IMPORT_C TIntRemoveFileSystem(const TDesC &aFileSystemName)const

Removes the specified file system from the file server and unloads its plugin dll (*.fsy)

Parameters
aFileSystemNameThe name of the file system to be removed. File system name that is bound to some drive can be retrieved by RFs::FileSystemName(). Note that this is _not_ the name of the plugin (*.fsy).
Return Value
KErrNone if successful KErrNotFound if aFileSystemName is not found otherwise one of the other system-wide error codes.
Capability
DiskAdmin

RemovePlugin ( const TDesC & )

IMPORT_C TIntRemovePlugin(const TDesC &aPluginName)const

Removes the specified plugin.

Parameters
aPluginNameThe full name of the plugin to be removed.
Return Value
KErrNone, if successful; KErrNotFound, if aPluginName is not found; otrherwise one of the other system-wide error codes.
Capability
DiskAdmin

RemoveProxyDrive ( const TDesC & )

IMPORT_C TIntRemoveProxyDrive(const TDesC &aDriveName)

Removes the specified extension.

Parameters
aDriveNameThe fullname of the extension, as returned from a call to ExtensionName().
Return Value
KErrNone, if successful; KErrInUse if there are still drives mounted that are using it KErrNotFound, if aExtensionName is not found; otherwise one of the other system-wide error codes.

Rename ( const TDesC &, const TDesC & )

IMPORT_C TIntRename(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.

See also: CFileMan

Parameters
anOldNameFile or directory to be renamed. Any path components which are not specified here will be taken from the session path.
aNewNamePath 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.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.
Capability
DependentIf either anOldName or aNewName is /Sys then Tcb capability is required.
DependentIf either anOldName or aNewName begins with /Private and does not match this process' SID then AllFiles capability is required.
DependentIf either anOldName or aNewName is /Resource then Tcb capability is required.

Replace ( const TDesC &, const TDesC & )

IMPORT_C TIntReplace(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.

Parameters
anOldNameThe file to be replaced. Must exist and must be closed. It is deleted by this function.
aNewNameThe 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.
Return Value
KErrNone, if successful; KErrAccessDenied, if an attempt is made to replace a directory; otherwise one of the other system-wide error codes.
Capability
DependentIf either anOldName or aNewName is /Sys then Tcb capability is required.
DependentIf either anOldName or aNewName begins with /Private and does not match this process' SID then AllFiles capability is required.
DependentIf either anOldName or aNewName is /Resource then Tcb capability is required.

ReserveDriveSpace ( TInt, TInt )

IMPORT_C TIntReserveDriveSpace(TIntaDriveNo,
TIntaSpace
)

Reserves an area of a drive. It is intended that sensible (tm) apps will reserve a small area of disk for 'emergency' use in case of later out of disk situations. If the amount of reserved space later needs to be readjusted, this method should be called again with aSpace as the amount of extra space needed.

Once space has been reserved via this method, an application can use RFs::GetReserveAccess to gain access to the reserved area prior to executing disk space critical sections of code. After the section of code is complete, the application should release access to the reserved area.

For internal drives, reserved space will be lost if a reboot occurs. For removeable drives, reserved space may be lost if there is a media change.

Reserved space will be cleaned up automatically when the RFs is closed.

Each drive has a max amount of space available to be reserved, and individual sessions also have a max amount of space. These are defined in f32/sfile/sf_std.h as KMaxTotalDriveReserved and KMaxSessionDriveReserved respectively. Once space is reserved, it is only available to the reserving session until that session releases the reserved space.

Parameters
aDriveNoWhich drive to reserve space on
aSpaceAmount of space to reserve
Return Value
KErrNone if successful KErrInUse if the session already has reserved access KErrArgument if aSpace is invalid (greater than KMaxSessionDriveReserved, negative number, etc.) KErrDiskFull if insufficient space is left on the drive to service the request KErrTooBig if this request would overflow the available reserve (greater than KMaxTotalDriveReserved) any of the possible error return codes from TDrive::Volume()

ResourceCount ( )

IMPORT_C TIntResourceCount()const

Gets the number of currently open resources.

The resource count is incremented by one: when a file or directory is opened, when a device is opened in preparation for formatting, when a direct access channel to a disk is opened.

Return Value
The number of resources currently open.

ResourceCountMarkEnd ( )

IMPORT_C voidResourceCountMarkEnd()const

Ends resource count checking. Typically, this function is called immediately before closing a session with the file server.

Panic Codes
CSessionFs2 if the number of resources opened since the start of resource count checking is not equal to the number of resources closed.

ResourceCountMarkStart ( )

IMPORT_C voidResourceCountMarkStart()const

Marks the start of resource count checking.

Typically, this function is called immediately after a client is connected to the file server, and before any resources are opened.

RmDir ( const TDesC & )

IMPORT_C TIntRmDir(const TDesC &aPath)

Removes a directory.

The directory must be empty and cannot be the root directory.

Note that if a filename is specified in the argument, it is ignored.

For example, following code will result in directory "C:\\SRC\\" being removed as long as it is empty, the existance of "ENTRY" will not be checked:

fs.RmDir(_L("C:\\SRC\\ENTRY"));
Similarly, following code will try to remove "C:\\SRC\\" instead of "C:\\SRC\DIR\\":
fs.RmDir(_L("C:\\SRC\\DIR"));

Therefore, there should be a trailing backslash after the final directory name in the argument to indicate that it is a directory, not a filename.

See class CFileMan for information on deleting a non-empty directory and all of its contents.

See also: CFileMan

Parameters
aPathThe path name of the directory to be removed. Any path components which are not specified here are taken from the session path. Only the lowest-level directory identified is removed.
Return Value
KErrNone, if successful; KErrInUse, if trying to remove a non-empty directory or root directory; otherwise, one of the other system-wide error codes.
Capability
DependentIf aPath is /Sys then Tcb capability is required.
DependentIf aPath begins with /Private and does not match this process' SID then AllFiles capability is required.
DependentIf aPath is /Resource then Tcb capability is required.

ScanDrive ( const TDesC & )

IMPORT_C TIntScanDrive(const TDesC &aDrive)const

Checks the integrity of the File System mounted on the specified drive and attempts to correct some known File System errors. The behaviour of this API and return codes are File System specific, dependent on how the File System implements its ScanDrive functionality.

ScanDrive will not run on drives that have files or directories opened.

FAT File System specific information:

ScanDrive is intended to be run ONLY on "Rugged-FAT" file system which is applicable to internal non-removable drives. Internal RAM drives are not supported.

The "Rugged FAT" file system is designed in such a way that only a limited number of known cases of corruption can be caused by sudden power loss. All of these known cases can be corrected by ScanDrive. Hence, running ScanDrive on "Rugged FAT" file system will result in: KErrNone If there was no File System corruption or ScanDrive has successfully repaired the File System. KErrCorrupt If ScanDrive has found a File System error that it cannot repair. Other system-wide error codes, see above.

Running ScanDrive on removable media or media that has FAT file system not in "Rugged FAT" mode is not practical, because ScanDrive is not designed for this. Therefore, do not treat ScanDrive on removable media as a generic "disk repair utility".

Parameters
aDrivePath indicating the drive which contains the disk to be checked. If the drive letter is not specified, the current session drive is taken by default.
Return Value
KErrNone On success. KErrInUse If drive is in use (i.e. if there are files and/or directories opened in the drive). KErrCorrupt If ScanDrive has detected a file system corruption that it cannot fix. KErrNotSupported If this functionality is not supported. KErrPermissionDenied If the caller does not have DiskAdmin capability. Other system-wide error codes.
Capability
DiskAdmin

SendReceive ( TInt, const TIpcArgs & )

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

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

Parameters
aFunctionThe function number identifying the request.
aArgsA set of up to 4 arguments and their types to be passed to the server.
Return Value
KErrNone, if the send operation is successful; KErrServerTerminated, if the server no longer present; KErrServerBusy, if there are no message slots available; KErrNoMemory, if there is insufficient memory available.
Panic Codes
USER72 if the function number is negative.

SessionPath ( TDes & )

IMPORT_C TIntSessionPath(TDes &aPath)const

Gets the session path.

When a client connects to the file server, its session path is initialised to the system default path. The session path of an existing client can only be changed by this function.

Parameters
aPathOn return, contains the session path, including a trailing backslash.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.

SetAllocFailure ( TInt )

IMPORT_C TIntSetAllocFailure(TIntaAllocNum)

Fails an allocation after aAllocNum successes.

This function can only be used in debug builds or if _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.

Parameters
aAllocNumCount after which allocation failure is expected.
Return Value
On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds. KErrNotSupported in release build.

SetAtt ( const TDesC &, TUint, TUint )

IMPORT_C TIntSetAtt(const TDesC &aName,
TUintaSetAttMask,
TUintaClearAttMask
)

Sets or clears the attributes of a single file or directory.

The function uses two bitmasks. The first bitmask specifies the attributes to be set; the second specifies the attributes to be cleared.

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

See also: RFs::SetEntry

Parameters
aNameFile or directory name. Any path components which are not specified here will be taken from the session path. Must not include wildcard characters. The file must be closed.
aSetAttMaskBitmask indicating the attributes to be set.
aClearAttMaskBitmask indicating the attributes to be cleared. For more information, see KEntryAttNormal and the other file or directory attributes.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.
Panic Codes
FSCLIENT21 if any attribute appears in both bitmasks.
Capability
DependentIf aName is /Sys then Tcb capability is required.
DependentIf aName begins with /Private and does not match this process' SID then AllFiles capability is required.
DependentIf aName is /Resource then Tcb capability is required.

SetDebugRegister ( TInt )

IMPORT_C TIntSetDebugRegister(TIntaVal)

Sets the debug register to the given value.

This function can only be used in debug builds or if _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.

Parameters
aValValue to be set
Return Value
On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds. KErrNotSupported in release build.

SetDefaultPath ( const TDesC & )

IMPORT_C TIntSetDefaultPath(const TDesC &aPath)

SetDriveName ( TInt, const TDesC & )

IMPORT_C TIntSetDriveName(TIntaDrive,
const TDesC &aDriveName
)

Sets the name of a drive.

Drive naming is optional. Any drive can be assigned a name, and more than one drive can share the same name.

Parameters
aDriveThe drive number. Specify a drive in the range EDriveA to EDriveZ for drives A to Z, respectively. Specify KDefaultDrive for the session default drive.
aDriveNameThe name of the drive, with a maximum of 256 characters. The name cannot contain the 6 characters < > : " / |
Return Value
KErrNone if successful; KErrBadName, if the name contains illegal characters; otherwise one of the other system-wide error codes.
Capability
DiskAdmin

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

IMPORT_C TIntSetEntry(const TDesC &aName,
const TTime &aTime,
TUintaSetAttMask,
TUintaClearAttMask
)

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.

See also: KEntryAttNormal KEntryAttDir KEntryAttVolume

Parameters
aNameFile or directory name.
aTimeNew date and time. UTC date and time should be used.
aSetAttMaskBitmask indicating which attributes are to be set.
aClearAttMaskBitmask indicating which attributes are cleared. For more information, see KEntryAttNormal, and the other file or directory attributes.
Return Value
KErrNone, if successful; KErrInUse, if the file is open; otherwise one of the other system-wide error codes.
Panic Codes
FSCLIENT21 if any attribute appears in both bitmasks.
Capability
DependentIf aName is /Sys then Tcb capability is required.
DependentIf aName begins with /Private and does not match this process' SID then AllFiles capability is required.
DependentIf aName is /Resource then Tcb capability is required.

SetErrorCondition ( TInt, TInt )

IMPORT_C TIntSetErrorCondition(TIntanError,
TIntaCount = 0
)

Sets the failure condition.

This function can only be used in debug builds or if _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.

Parameters
anErrorAn error condition to be simulated
aCountAn error condition is set after aCount instances of occurence.
Return Value
On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds. KErrNotSupported in release build.

SetLocalDriveMapping ( const TDesC8 & )

IMPORT_C TIntSetLocalDriveMapping(const TDesC8 &aMapping)

SetModified ( const TDesC &, const TTime & )

IMPORT_C TIntSetModified(const TDesC &aName,
const TTime &aTime
)

Sets the date and time that the contents of a file or directory were modified, in UTC.

Parameters
aNameFile or directory name.
aTimeThe new date and time that the file or directory was modified in universal time.
Return Value
KErrNone if successful; KErrInUse, if the file is open; otherwise one of the other system-wide error codes.
Capability
DependentIf aName is /Sys then Tcb capability is required.
DependentIf aName begins with /Private and does not match this process' SID then AllFiles capability is required.
DependentIf aName is /Resource then Tcb capability is required.

SetNotifyChange ( TBool )

IMPORT_C TIntSetNotifyChange(TBoolaNotifyChange)

Enables/Disables change notification on a per-session basis. Change notification is enabled by default, and can be disabled using this API. Disabling change notification will result in clients of the file server not being notified of events such as directory/file changes.

See also: RFs::NotifyChange

Parameters
aNotifyChangeETrue to enable change notifications, EFalse to disable.
Return Value
KErrNone if successful.
Capability
DiskAdmin

SetNotifyUser ( TBool )

IMPORT_C voidSetNotifyUser(TBoolaValue)

Sets whether the user should be notified of file read or write failure. Note that if some drive is mounted as synchronous (see RFs::MountFileSystem), the user won't be notified about read/write failures on it.

Parameters
aValueETrue, if user is to be notified of read or write failures; EFalse, for no notification.

SetSessionPath ( const TDesC & )

IMPORT_C TIntSetSessionPath(const TDesC &aPath)

Sets the session path for the current file server client.

When the client first connects to the file server, its session path is initialised to the system default path.

Note that the session path is text-only. It does not cause any locking. Thus, although the path must be syntactically correct, its components do not need to be valid at the time the path is set, and any component may be deleted, removed or unmounted while the path is set.

Parameters
aPathThe new session path. Consists of a drive and path. Normally, a drive should be specified, but if not, the drive specified in the existing session path is preserved. If a file is specified, then the function fails and returns an error code. Therefore, the final component in the path must have a trailing backslash to indicate that it is a directory. All components of the path must be syntactically correct, for example, wildcard characters and double backslashes are not allowed in any part of it.
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes.
Capability
DependentIf aPath is /Sys then AllFiles capability is required.
DependentIf aPath begins with /Private and does not match this process' SID then AllFiles capability is required.

SetSessionToPrivate ( TInt )

IMPORT_C TIntSetSessionToPrivate(TIntaDrive)

Sets the session path to point to the private path on the specified drive.

The private directory does not need to exist at this point.

The private path for a process has the form: \Private\13579BDF\ where 13579BDF is the identity of the process.

Parameters
aDriveThe drive for which information is requested. Specify a drive in the range EDriveA to EDriveZ for drives A to Z respectively.
Return Value
KErrNone, if successful, otherwise one of the other system-wide error codes.

SetStartupConfiguration ( TInt, TAny *, TAny * )

IMPORT_C TIntSetStartupConfiguration(TIntaCommand,
TAny *aParam1,
TAny *aParam2
)const

Only can be called in estart. Licensees could use this function to configure file server at startup through their own version of estart.

Currently only loader thread priority can be specified.

Parameters
aCommandCommand indicating what aspect of file server should be configured. aParam1 Command specific parameter. aParam2 Command specific parameter.
Return Value
KErrNone if successful, KErrPermissionDenied if called outside estart

SetSubst ( const TDesC &, TInt )

IMPORT_C TIntSetSubst(const TDesC &aPath,
TIntaDrive =  KDefaultDrive
)

Assigns a path to a drive letter.

Whenever that drive letter is used, it will be translated into a reference to the path specified here. To clear a drive substitution, specify an empty descriptor for aPath.

Note that the substituted path is text-only. Its components need not be syntactically correct, nor must they be valid at the time the substitution is set. Any component may be deleted, removed or unmounted while the substitution is set.

Parameters
aPathThe path to be assigned to the drive letter. If a drive letter is specified in the path, it must not itself be substituted or redirected, or the function will return an error. If no drive is specified, the drive contained in the default session path is used, and if no path is specified, the default session path is used. If a filename or extension is included in the path, the function will return an error. Therefore, the final component in the path must have a trailing backslash to indicate that it is a directory.
aDriveThe drive to which a path is to be assigned. Specify a number in the range 0 (EDriveA) to 25 (EDriveZ) for drives A to Z. Must not be local, ROM, or redirected, otherwise an error is returned. May be substituted, but only if the function is being used to clear the substitution. If the same drive is specified in the path, the function will return an error. The default drive is the session default drive KDefaultDrive.
Return Value
KErrNone, if successful; otherwise one of the other system-wide error codes.
Capability
DiskAdmin
DependentIf aPath is /Sys then Tcb capability is required.
DependentIf aPath begins with /Private and does not match this process' SID then AllFiles capability is required.
DependentIf aPath is /Resource then Tcb capability is required.

SetSystemDrive ( TDriveNumber )

IMPORT_C TIntSetSystemDrive(TDriveNumberaSystemDrive)

Set a specified drive as a "System Drive", see RFs::GetSystemDrive(). The "System Drive" can be set only once, any subsequent calls will result in the error 'KErrAlreadyExists'.

The media type for the system drive shall be one of the: EMediaHardDisk, EMediaFlash, EMediaNANDFlash, EMediaRam Required drive attributes: KDriveAttLocal, KDriveAttInternal Prohibited drive attributes: KDriveAttRom,KDriveAttRedirected,KDriveAttSubsted,KDriveAttRemovable

Parameters
aSystemDrivespecifies the drive number to be set as System Drive
Return Value
KErrNone if successful, otherwise one of the other system-wide error codes
Capability
TCB

SetVolumeLabel ( const TDesC &, TInt )

IMPORT_C TIntSetVolumeLabel(const TDesC &aName,
TIntaDrive = KDefaultDrive
)

Sets the label for a volume.

Note that similar to file names, volume labels can be set with unicode characters. However it may not be recognized properly if correct code page is not loaded or it is mounted onto a system that does not support DBCS volume labels

See also: TDriveNumber TVolumeInfo::iName RFs::Volume

Parameters
aNameThe volume label.
aDriveThe drive containing the media whose label is to be set. Specify a drive in the range EDriveA to EDriveZ for drives A to Z. The default drive is the session default drive KDefaultDrive.
Return Value
KErrNone, if successful; KErrNotReady, if the drive contains no media; otherwise one of the other system-wide error codes.
Capability
DiskAdmin

StartupInitComplete ( TRequestStatus & )

IMPORT_C voidStartupInitComplete(TRequestStatus &aStat)

Noifies the file server that startup initialisation is complete.

Parameters
aStatRequest status object.

Subst ( TDes &, TInt )

IMPORT_C TIntSubst(TDes &aPath,
TIntaDrive = KDefaultDrive
)const

Gets the path assigned to a drive letter by an earlier call to SetSubst().

To find out whether a drive letter has been substituted, first get the drive information, using Drive(), and then test the value of the KDriveAttSubsted bit provided by TDriveInfo::iDriveAtt.

See also: RFs::SetSubst TDriveInfo RFs::Drive

Parameters
aPathOn return, contains the path which has been assigned to the drive. If the drive letter has not been substituted, this argument returns an empty descriptor.
aDriveThe drive which is the subject of the enquiry. Specify a number in the range 0 (EDriveA) to 25 (>EDriveZ) for drives A to Z. The default drive is the session default drive KDefaultDrive.
Return Value
KErrNone, if successful, otherwise one of the other system-wide error codes.

SupportedFileSystemName ( TDes &, TInt, TInt )

IMPORT_C TIntSupportedFileSystemName(TDes &aName,
TIntaDrive,
TIntaFsEnumerator
)const

Get one of the supported file system names on a specified drive. This API can be used for enumerating file systems that can be recognised and mounted automatically, without user's interaction. If the automatic recognition and mountng some known file systems is supported on the specified drive, there shall be at least 2 names in the list. For example "FAT" and "exFAT". If "automatic file system recognising" feature is not supported, the list will consist of just one name, and this will be the name returned by RFs::FileSystemName() API.

Note that the file system name, returned in the aName descriptor shall be threated as case-insensitive string. I.e. "fileSystem" and "FILESYSTEM" mean absolutely the same. Therefore, case-insensitive string methods (like TDesC::FindF(), TDesC::CompareF()) shall be used to deal with the names.

See also: FileSystemName() KRootFileSystem

Parameters
aNameOn successful return, contains the name of the file system that correspond to the aFsEnumerator value. m
aDriveThe drive number
aFsEnumeratorThe supported file system enumerator. can be: KRootFileSystem a special value; in this case the returned name will be the same as obtained by FileSystemName() 0,1,2... integer values specifying the sequential number of supported filesystem. See the return error code.
Return Value
KErrNone success, aName contains a valid name for the supported file system number "aFsEnumerator" on this drive. KErrNotFound the end of the supported file names list; "aFsEnumerator-1" was the last correct value KErrArgument incorrect arguments

SwapFileSystem ( const TDesC &, const TDesC &, TInt )

IMPORT_C TIntSwapFileSystem(const TDesC &aOldFileSystemName,
const TDesC &aNewFileSystemName,
TIntaDrive
)const

Dismount aOldFileSystemName and mount aNewFileSystemName in an atomic operation

If swapping in the composite filesystem, and no mounts have been added to it, then ROFS is added to it by default. The synchronous state of the composite filesystem will be used in preference to that of the old filesystem when it is mounted.

Parameters
aOldFileSystemNameThe filesystem name that is currently on the drive.
aNewFileSystemNameThe filesystem name that is to be swapped onto the drive.
aDriveThe drive for which the filesystem is to be swapped.
Return Value
KErrNone if successful KErrInUse if a dismount is pending on the drive KErrNotSupported if swapping Z drive with something other then composite or if the drive is asynchronous KErrAlreadyExists if swapping the composite filesystem, and it is already mounted KErrNotFound If the filesystem name provided could not be found.
Capability
DiskAdmin

Unclamp ( const RFileClamp & )

TInt Unclamp(const RFileClamp &aHandle)

Makes available for paging-out the media space occupied by the file identified by the supplied handle.

See also: RFile::Clamp

Parameters
aHandlehandle to the file on the media.
Return Value
KErrNone if successful.
Capability
???

UnlockDrive ( TInt, const TMediaPassword &, TBool )

IMPORT_C TIntUnlockDrive(TIntaDrv,
const TMediaPassword &Pswd,
TBoolaStr
)

Unlocks the media in the specified drive.

The password must be added to the MultiMedia card controller's password store so that the controller can subsequently issue the password without the user having to be prompted for it again.

Parameters
aDrvThe drive.
PswdThe password.
aStrSpecify ETrue to add the password to the controller's password store.
Return Value
KErrNone, if successful; KErrAccessDenied, if the password is incorrect; KErrAlreadyExists, if the card has already been unlocked; KErrNotSupported, if the media does not support password locking.
Capability
DiskAdmin

Version ( )

IMPORT_C TVersionVersion()const

Gets the client side version number.

Return Value
The client side version number.

Volume ( TVolumeInfo &, TInt )

IMPORT_C TIntVolume(TVolumeInfo &aVol,
TIntaDrive = 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.

See also: RFs::Drive

Parameters
aVolOn return, contains the volume information.
aDriveThe 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.
Return Value
KErrNone, if successful; KErrNotReady, if the drive contains no media; otherwise one of the other system-wide error codes.

Volume ( TVolumeInfo &, TInt, TRequestStatus & )

IMPORT_C voidVolume(TVolumeInfo &aVol,
TIntaDrive,
TRequestStatus &aStat
)const

Gets volume information for a formatted device asynchronously.

See also: TInt RFs::Volume(TVolumeInfo& aVol,TInt aDrive) for the synchronous version.

"Asynchronously" corresponds to the amount of free space on the volume in TVolumeInfo::iFree. I.e. this function returns the _current_ amount of free space on the volume, which can be changing due to some filesystems' activities. For example, some filesystems can be performing free space calculations in the background. Comparing to the RFs::Volume(TVolumeInfo& aVol,TInt aDrive), this method doesn't block the client until background filesystem activity finishes, which can be useful in some situations.

Parameters
aVolOn return, contains the volume information with the _current_ value in the TVolumeInfo::iFree.
aDriveDrive number to query. Specify a drive in the range EDriveA to EDriveZ for drives A to Z respectively.
aStatrequest status. At present is used just for indication of the asynchronous version and gets immediately completed, so there is no reason to analyse its value.

VolumeIOParam ( TInt, TVolumeIOParamInfo & )

IMPORT_C TIntVolumeIOParam(TIntaDriveNo,
TVolumeIOParamInfo &aParamInfo
)const

This function queries a set of I/O parameters on the specified volume, this includes the block size of underlying media, cluster size of the mounted file system and the recommended read/write buffer sizes.

The volume information is retuned through aParamInfo. Even if VolumeIOParam() returns successful, errors can effect the return value of each field within aParamInfo.

Parameters
aDriveNoA drive number, specifies which volume to query.
aParamInfoA TVolumeIOParamInfo containing the volume parameters.
Return Value
KErrNone if successful; otherwise, another system wide error code is returned.