|
||
class RFs : public RSessionBase;
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 file’s 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.
RHandleBase
- A handle to an object
RSessionBase
- Client-side handle to a session with a server
RFs
- A handle to a file server session
Defined in RFs
:
AddCompositeMount()
Adds a local drive to the composite filesystemAddExtension()
Loads the specified extensionAddFileSystem()
Adds a file system to the file serverAllowDismount()
Used by a client to indicate that it is safe to dismount the file systemAtt()
Gets a file's attributesCharToDrive()
Maps a drive character to a drive numberCheckDisk()
Checks the integrity of the disk on the specified driveClearPassword()
Clears the password from the locked MultiMedia card in the specified driveConnect()
Connects a client to the file serverControlIo()
General purpose test interface - file system specificControlIo()
General purpose test interface - file system specificControlIo()
General purpose test interface - file system specificControlIo()
General purpose test interface - file system specificCreatePrivatePath()
Creates the private path for a process on the specified driveDebugNotify()
Request notification of a file server event - file system specificDelete()
Deletes a single fileDismountExtension()
Dismounts the specified extensionDismountFileSystem()
Dismounts the file system from the specified driveDrive()
Gets information about a drive and the medium mounted on itDriveList()
Gets a list of the available (not remote and non hidden) drivesDriveList()
Gets a list of the available drives that match a combination of drive attributes,specified in aFlagsDriveToChar()
Maps a drive number to the corresponding characterEFinal_RO
after successful finalisation the drive becomes read-onlyEFinal_RW
after successful finalisation the drive remains writable and will become "not finalised" after the first write operationEntry()
Gets the entry details for a file or directoryErasePassword()
Erase the password from the locked MultiMedia card in the specified driveExtensionName()
Gets the name of the extension on the specified drive at the specified position in the extension hierarchyFileSystemName()
Gets the name of the file system mounted on the specified driveFileSystemSubType()
This function queries the sub type of the file system mounted on the specified volumeFinaliseDrive()
Finalise the given driveFinaliseDrives()
Makes the best effort to finalise all drives in the systemGetDir()
Gets a filtered list of a directory's contentsGetDir()
Gets a filtered list of the directory and file entries contained in a directory, and a list of the directory entries onlyGetDir()
Gets a filtered list of a directory's contents by UID typeGetDriveName()
Gets the name of a driveGetLongName()
Gets the long filename associated with a short (8.3) filenameGetMediaSerialNumber()
Gets the serial number of mediaGetNotifyUser()
Tests whether user notification of file read or write failure is in effectGetReserveAccess()
Get exclusive access for this session to overwrite a specific disk area, which has previously been reserved via RFs::ReserveDriveSpaceGetShortName()
Gets the short filename associated with a VFAT long filenameGetSystemDrive()
Obtain the system drive numberGetSystemDriveChar()
This is a wrapper around GetSystemDrive() functionInitialisePropertiesFile()
Sets the F32 properties file - Can only be called from the ESTART processIsFileInRom()
Gets a pointer to the specified file, if it is in ROMIsFileOpen()
Tests whether a file is openIsRomAddress()
Tests whether the specified address is in ROMIsValidDrive()
Tests whether the specified drive number is validIsValidName()
Tests whether a filename and path are syntactically correctIsValidName()
The following restrictions apply to the path and to its components:LoaderHeapFunction()
This member function is not implemented in this version of Symbian OSLockDrive()
Sets the password for the media in the specified driveMkDir()
Makes a directoryMkDirAll()
Makes one or more directoriesModified()
Gets the last modification date and time of a file or a directory, in UTCMountExtension()
Mounts the the specified extensionMountFileSystem()
Mounts a file system on a driveMountFileSystem()
Mounts a file system on a specified driveMountFileSystem()
Mounts a file system on a drive, and the specified extensionMountFileSystem()
Mounts a file system on a drive, and the specified extensionMountFileSystemAndScan()
Mounts a file system on a drive, and performs a scan on that driveMountFileSystemAndScan()
Mounts a file system on a drive, and the specified extension and performs a scan on that driveNotifyChange()
Requests a notification of change to files or directoriesNotifyChange()
Requests a notification of change to files or directories, allowing a directory/file path to be specifiedNotifyChangeCancel()
Cancels all outstanding requests for notification of change to files or directoriesNotifyChangeCancel()
Cancels the specific request for notification of change to files or directoriesNotifyDiskSpace()
Requests notification when the free disk space on the specified drive crosses the specified threshold valueNotifyDiskSpaceCancel()
Cancels a specific outstanding request for free disk space notificationNotifyDiskSpaceCancel()
Cancels all outstanding requests for free disk space notificationNotifyDismount()
Sets up a pending dismount notifier, the type of which is specified by TNotifyDismountModeNotifyDismountCancel()
Cancels the oustanding dismount notifier, completing with KErrCancelNotifyDismountCancel()
Cancel all oustanding dismount notifiers for this session, completing with KErrCancelParse()
Parses a filename specificationParse()
Parses a filename specification, specifying related file path componentsPrivatePath()
Creates the text defining the private path for a processReadFileSection()
Reads data from a file without opening itRealName()
Gets the real name of a fileReleaseReserveAccess()
Release exclusive access for this session to overwrite a specific disk areaRemountDrive()
Forces a remount of the specified driveRemoveExtension()
Removes the specified extensionRemoveFileSystem()
Removes the specified file systemRename()
Renames a single file or directoryReplace()
Replaces a single file with anotherReserveDriveSpace()
Reserves an area of a driveResourceCount()
Gets the number of currently open resourcesResourceCountMarkEnd()
Ends resource count checkingResourceCountMarkStart()
Marks the start of resource count checkingRmDir()
Removes a directoryScanDrive()
Checks the specified drive for errors and corrects themSessionPath()
Gets the session pathSetAllocFailure()
Fails an allocation after aAllocNum successesSetAtt()
Sets or clears the attributes of a single file or directorySetDebugRegister()
Sets the debug register to the given valueSetDriveName()
Sets the name of a driveSetEntry()
Sets both the attributes and the last modified date and time for a file or directorySetErrorCondition()
Sets the failure conditionSetLocalDriveMapping()
SetModified()
Sets the date and time that the contents of a file or directory were modified, in UTCSetNotifyChange()
Enables/Disables change notification on a per-session basisSetNotifyUser()
Sets whether the user should be notified of file read or write failureSetSessionPath()
Sets the session path for the current file server clientSetSessionToPrivate()
Sets the session path to point to the private path on the specified driveSetSubst()
Assigns a path to a drive letterSetSystemDrive()
Set a specified drive as a "System Drive", see RFs::GetSystemDrive()SetVolumeLabel()
Sets the label for a volumeStartupInitComplete()
Noifies the file server that startup initialisation is completeSubst()
Gets the path assigned to a drive letter by an earlier call to SetSubst()SwapFileSystem()
Dismount aOldFileSystemName and mount aNewFileSystemName in an atomic operationTFinaliseDrvMode
specifies drive finalisation modesUnlockDrive()
Unlocks the media in the specified driveVersion()
Gets the client side version numberVolume()
Gets volume information for a formatted deviceVolumeIOParam()
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 sizesInherited from RHandleBase
:
Attributes()
BTraceId()
Returns a unique object identifier for use with BTraceClose()
Closes the handleDuplicate()
Creates a valid handle to the kernel object for which the specified thread already has a handleFullName()
Gets the full name of the handleHandle()
Retrieves the handle-number of the object associated with this handleHandleInfo()
Gets information about the handleName()
Gets the name of the handleSetHandle()
Sets the handle-number of this handle to the specified valueSetHandleNC()
Sets the handle-number of this handle to the specified value, and marks it as not closableiHandle
Inherited from RSessionBase
:
CreateSession()
Creates a session with a server, specifying no message slotsEAutoAttach
EExplicitAttach
Open()
Opens a handle to a session using a handle number sent by a client to a serverSend()
Issues a blind request to the server with the specified function number, and argumentsSendReceive()
Issues an asynchronous request to the server with the specified function number and argumentsSetReturnedHandle()
Sets the handle-number of this handle to the specified valueShareAuto()
Creates a session that can be shared by other threads in the current processShareProtected()
Creates a session handle that can be be passed via IPC to another process as well as being shared by other threads in the
current processTAttachMode
Indicates whether or not threads in the process are automatically attached to the session when passed as a parameter to the
Share() functionIMPORT_C TInt Connect(TInt aMessageSlots=KFileServerDefaultMessageSlots);
Connects a client to the file server.
To end the file server session, use Close()
.
|
|
IMPORT_C TVersion Version() const;
Gets the client side version number.
|
Capability: | DiskAdmin |
IMPORT_C TInt AddFileSystem(const TDesC &aFileName) const;
Adds a file system to the file server.
After calling this function, use MountFileSystem()
to mount the file system on a drive.
|
|
Capability: | DiskAdmin |
IMPORT_C TInt MountFileSystem(const TDesC &aFileSystemName, TInt aDrive) 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;
|
|
Capability: | DiskAdmin |
IMPORT_C TInt MountFileSystem(const TDesC &aFileSystemName, TInt aDrive, TBool aIsSync) const;
Mounts a file system on a specified 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.
|
|
Capability: | DiskAdmin |
IMPORT_C TInt MountFileSystemAndScan(const TDesC &aFileSystemName, TInt aDrive, TBool &aIsMountSuccess) const;
Mounts a file system on a drive, and performs a scan on that drive. 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;
|
|
Capability: | DiskAdmin |
IMPORT_C TInt MountFileSystem(const TDesC &aFileSystemName, const TDesC &aExtensionName, TInt aDrive);
Mounts a file system on a drive, and the specified extension.
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;
|
|
Capability: | DiskAdmin |
IMPORT_C TInt MountFileSystem(const TDesC &aFileSystemName, const TDesC &aExtensionName, TInt aDrive, TBool aIsSync);
Mounts a file system on a drive, and the specified extension.
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 sense if the operations on such drive are very fast e.g. this is an internal RAM or ROFS drive.
|
|
Capability: | DiskAdmin |
IMPORT_C TInt MountFileSystemAndScan(const TDesC &aFileSystemName, const TDesC &aExtensionName, TInt aDrive, TBool &aIsMountSuccess)
const;
Mounts a file system on a drive, and the specified extension and performs a scan on that drive.
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 operation is asynchronous, i.e other concurrent file server operations can continue.
|
|
Capability: | DiskAdmin |
IMPORT_C TInt DismountFileSystem(const TDesC &aFileSystemName, TInt aDrive) const;
Dismounts the file system from the specified drive.
|
|
Capability: | DiskAdmin |
IMPORT_C TInt RemoveFileSystem(const TDesC &aFileSystemName) const;
Removes the specified file system.
|
|
IMPORT_C TInt FileSystemName(TDes &aName, TInt aDrive) const;
Gets the name of the file system mounted on the specified drive.
The function can be called before calling DismountFileSystem()
.
|
|
IMPORT_C TInt AddExtension(const TDesC &aFileName);
Loads the specified extension.
|
|
IMPORT_C TInt MountExtension(const TDesC &aExtensionName, TInt aDrive);
Mounts the the specified extension.
The extension must first have been loaded using AddExtension()
.
|
|
IMPORT_C TInt DismountExtension(const TDesC &aExtensionName, TInt aDrive);
Dismounts the specified extension.
|
|
IMPORT_C TInt RemoveExtension(const TDesC &aExtensionName);
Removes the specified extension.
|
|
IMPORT_C TInt ExtensionName(TDes &aExtensionName, TInt aDrive, TInt aPos);
Gets the name of the extension on the specified drive at the specified position in the extension hierarchy.
|
|
IMPORT_C TInt RemountDrive(TInt aDrive, const TDesC8 *aMountInfo=0,TUint aFlags=0);
Forces a remount of the specified drive.
|
|
IMPORT_C void NotifyChange(TNotifyType aType, 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.
|
Capability: | Dependent | If aName is /Sys then AllFiles capability is required. If aName begins with /Private and does not match this process' SID then AllFiles capability is required. |
IMPORT_C void NotifyChange(TNotifyType aType, 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.
|
IMPORT_C void NotifyChangeCancel();
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.
IMPORT_C void NotifyChangeCancel(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.
|
IMPORT_C void NotifyDiskSpace(TInt64 aThreshold, TInt aDrive, 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.
|
TDriveNumber
The drive number enumerationIMPORT_C void NotifyDiskSpaceCancel(TRequestStatus &aStat);
Cancels a specific outstanding request for free disk space notification.
The outstanding request completes with KErrCancel.
|
IMPORT_C void NotifyDiskSpaceCancel();
Cancels all outstanding requests for free disk space notification.
Outstanding requests complete with KErrCancel.
IMPORT_C TInt DriveList(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 wether 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.
|
|
IMPORT_C TInt DriveList(TDriveList &aList, TUint aFlags) 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 wether 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.
|
|
IMPORT_C TInt Drive(TDriveInfo &anInfo, TInt aDrive=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.
|
|
IMPORT_C TInt Volume(TVolumeInfo &aVol, TInt aDrive=KDefaultDrive) const;
Gets volume information for a formatted device.
This function provides additional information to that given by Drive()
, including the volume label, if set, and the amount of free space on the disk.
Note, use Drive()
to get information about the drive without reference to a volume. These two functions are separate because, while the characteristics
of a drive cannot change, those of a volume can, by mounting different media, reformatting etc. A volume may not even be present
if the media is removable.
|
|
Capability: | DiskAdmin |
IMPORT_C TInt SetVolumeLabel(const TDesC &aName, TInt aDrive=KDefaultDrive);
Sets the label for a volume.
|
|
TDriveNumber
The drive number enumerationTVolumeInfo::iName
Name of the volume, with a maximum of KMaxFileName charactersIMPORT_C TInt Subst(TDes &aPath, TInt aDrive=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
.
|
|
TDriveInfo
Contains drive informationCapability: | Dependent | If aPath is /Sys then Tcb capability is required. If aPath begins with /Private and does not match this process' SID then AllFiles capability is required. If aPath is /Resource then Tcb capability is required. |
Capability: | DiskAdmin |
IMPORT_C TInt SetSubst(const TDesC &aPath, TInt aDrive=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.
|
|
Capability: | Dependent | If aName is /Sys then AllFiles capability is required. If aName begins with /Private and does not match this process' SID then AllFiles capability is required. |
IMPORT_C TInt RealName(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.
|
|
IMPORT_C TInt GetMediaSerialNumber(TMediaSerialNumber &aSerialNum, TInt aDrive);
Gets the serial number of media.
Only local drive is allowed. Substed drive number will return KErrNotSupported.
|
|
IMPORT_C TInt SessionPath(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.
|
|
Capability: | Dependent | If aPath is /Sys then AllFiles capability is required. If aPath begins with /Private and does not match this process' SID then AllFiles capability is required. |
IMPORT_C TInt SetSessionPath(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.
|
|
IMPORT_C TInt Parse(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.
|
|
IMPORT_C TInt Parse(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.
|
|
Capability: | Dependent | If aPath is /Sys then Tcb capability is required. If aPath begins with /Private and does not match this process' SID then AllFiles capability is required. If aPath is /Resource then Tcb capability is required. |
IMPORT_C TInt MkDir(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 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.
|
|
Capability: | Dependent | If aPath is /Sys then Tcb capability is required. If aPath begins with /Private and does not match this process' SID then AllFiles capability is required. If aPath is /Resource then Tcb capability is required. |
IMPORT_C TInt MkDirAll(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.
|
|
Capability: | Dependent | If aPath is /Sys then Tcb capability is required. If aPath begins with /Private and does not match this process' SID then AllFiles capability is required. If aPath is /Resource then Tcb capability is required. |
IMPORT_C TInt RmDir(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.
|
|
CFileMan
Offers file management services which accept the use of wildcards; synchronous and asynchronousIMPORT_C TInt GetDir(const TDesC &aName, TUint anEntryAttMask, TUint anEntrySortKey, 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.
|
|
TEntryKey
Flags indicating the order in which directory entries are to be sortedIMPORT_C TInt GetDir(const TDesC &aName, TUint anEntryAttMask, TUint anEntrySortKey, 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.
|
|
TEntryKey
Flags indicating the order in which directory entries are to be sortedIMPORT_C TInt GetDir(const TDesC &aName, const TUidType &anEntryUid, TUint anEntrySortKey, 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.
|
|
TEntryKey
Flags indicating the order in which directory entries are to be sortedCapability: | Dependent | If aName is /Sys then Tcb capability is required. If aName begins with /Private and does not match this process' SID then AllFiles capability is required. If aName is /Resource then Tcb capability is required. |
IMPORT_C TInt Delete(const TDesC &aName);
Deletes a single file.
Wildcards are not allowed in either the file name or the extension, otherwise an error is returned.
Note that the file must be closed and must not be read-only. Hidden files can be deleted but system files cannot.
See class CFileMan
for information on deleting multiple files.
|
|
CFileMan
Offers file management services which accept the use of wildcards; synchronous and asynchronousCapability: | Dependent | If either anOldName or aNewName is /Sys then Tcb capability is required. If either anOldName or aNewName begins with /Private and does not match this process' SID then AllFiles capability is required. If either anOldName or aNewName is /Resource then Tcb capability is required. |
IMPORT_C TInt Rename(const TDesC &anOldName, const TDesC &aNewName);
Renames a single file or directory.
It can also be used to move a file or directory by specifying different destination and source directories. If so, the destination and source directories must be on the same drive. If a directory is moved, then the directory structure beneath it is also moved.
If a directory specified by aNewName is different from one specified by anOldName, then the file or directory is moved to
the new directory. The file or directory cannot be moved to another device by this means, either explicitly (by another drive
specified in the name) or implicitly (because the directory has been mapped to another device with SetSubst()
.
The function fails and returns an error code in the following circumstances:
1. If either the old or new name includes wildcards.
2. If a file or directory with the new name already exists in the target directory. Overwriting is not permitted.
3. If file anOldName does not exist, or is open.
Read-only, system and hidden files may be renamed. The renamed file's attributes are preserved.
Note that when this function is operating on directories, a trailing backslash is not required after the final directory name in either anOldName or aNewName.
See class CFileMan
for information on renaming multiple files.
|
|
CFileMan
Offers file management services which accept the use of wildcards; synchronous and asynchronousCapability: | Dependent | If either anOldName or aNewName is /Sys then Tcb capability is required. If either anOldName or aNewName begins with /Private and does not match this process' SID then AllFiles capability is required. If either anOldName or aNewName is /Resource then Tcb capability is required. |
IMPORT_C TInt Replace(const TDesC &anOldName, const TDesC &aNewName);
Replaces a single file with another.
This function does not support the use of wildcards. Unlike Rename()
, it only applies to files.
This function operates as follows:
1. if the aNewName file does not exist, it is created.
2. anOldName's contents, attributes and the date and time of its last modification are copied to file aNewName, overwriting any existing contents and attribute details.
3. anOldName is deleted.
anOldName may be hidden, read-only or a system file. However, neither anOldName, nor, if it exists, aNewName, can be open; aNewName must not be read-only. Both files must be on the same drive.
|
|
Capability: | Dependent | If aName contains /sys/ then AllFiles capability is required. If aName contains /Private/ and does not match this process' SID then AllFiles capability is required. |
IMPORT_C TInt Att(const TDesC &aName, TUint &aAttValue) const;
Gets a file's attributes.
|
|
KEntryAttNormal
File/directory attribute: any file without the hidden or system attributeCapability: | Dependent | If aName is /Sys then Tcb capability is required. If aName begins with /Private and does not match this process' SID then AllFiles capability is required. If aName is /Resource then Tcb capability is required. |
IMPORT_C TInt SetAtt(const TDesC &aName, TUint aSetAttMask, TUint aClearAttMask);
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.
|
|
|
Capability: | Dependent | If aName contains /sys/ then AllFiles capability is required. If aName contains /Private/ and does not match this process' SID then AllFiles capability is required. |
IMPORT_C TInt Modified(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.
|
|
Capability: | Dependent | If aName is /Sys then Tcb capability is required. If aName begins with /Private and does not match this process' SID then AllFiles capability is required. If aName is /Resource then Tcb capability is required. |
IMPORT_C TInt SetModified(const TDesC &aName, const TTime &aTime);
Sets the date and time that the contents of a file or directory were modified, in UTC.
|
|
Capability: | Dependent | If aName contains "\\Sys\\" and includes an additional file or directory then AllFiles capability is required. For example, the paths "c:\\sys" and "c:\\sys\\" will always be readable, whereas the path "c:\\sys\\abc\\" will only be readable with AllFiles capability. If aName contains \Private\ and includes an additional file, or a directory which does not match this process' SID, then AllFiles capability is required. For example, the paths "c:\\private" and "c:\\private\\" will always be readable, whereas the path "c:\\private\\<n>\\" will only be readable with AllFiles capability or if matches the process' SID. |
IMPORT_C TInt Entry(const TDesC &aName, TEntry &anEntry) const;
Gets the entry details for a file or directory.
This information includes UID information.
|
|
Capability: | Dependent | If aName is /Sys then Tcb capability is required. If aName begins with /Private and does not match this process' SID then AllFiles capability is required. If aName is /Resource then Tcb capability is required. |
IMPORT_C TInt SetEntry(const TDesC &aName, const TTime &aTime, TUint aSetAttMask, TUint aClearAttMask);
Sets both the attributes and the last modified date and time for a file or directory.
The function uses two bitmasks. The first bitmask determines which attributes should be set. The second bitmask determines which should be cleared.
An attempt to set or clear the KEntryAttDir, KEntryAttVolume or KEntryAttRemote attributes have no effect.
|
|
|
KEntryAttNormal
File/directory attribute: any file without the hidden or system attributeKEntryAttDir
File/directory attribute: a directory without the hidden or system attributeKEntryAttVolume
File/directory attribute: volume name directoryCapability: | Dependent | If the path for aName starts with /Sys capability AllFiles is required If the path for aName starts with /Private and this process does not have the relevant SID capability AllFiles is required |
IMPORT_C TInt ReadFileSection(const TDesC &aName, TInt aPos, TDes8 &aDes, TInt aLength) const;
Reads data from a file without opening it.
The contents of the file can be accessed regardless of the file's lock state.
The file may be open by any number of other clients for reading or writing. In allowing such access to a file, the fileserver makes no guarantees as to the validity of the data it returns.
|
|
|
static IMPORT_C TBool IsValidDrive(TInt aDrive);
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).
|
|
TDriveNumber
The drive number enumerationstatic IMPORT_C TInt CharToDrive(TChar aChar, TInt &aDrive);
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.
|
|
TDriveNumber
The drive number enumerationstatic IMPORT_C TInt DriveToChar(TInt aDrive, TChar &aChar);
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.
|
|
static IMPORT_C TBool IsRomAddress(TAny *aAny);
Tests whether the specified address is in ROM.
|
|
static IMPORT_C TDriveNumber GetSystemDrive();
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.
|
TDriveNumber
The drive number enumerationstatic IMPORT_C TChar GetSystemDriveChar();
This is a wrapper around GetSystemDrive()
function. It returns the character corresponding to the system drive.
aDriveChar On return, contains the system drive character
|
Capability: | TCB |
IMPORT_C TInt SetSystemDrive(TDriveNumber aSystemDrive);
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
|
|
IMPORT_C void ResourceCountMarkStart() 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.
IMPORT_C void ResourceCountMarkEnd() const;
Ends resource count checking.
A panic is raised if the number of resources opened since the start of resource count checking is not equal to the number of resources closed. Typically, this function is called immediately before closing a session with the file server.
IMPORT_C TInt ResourceCount() 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.
|
Capability: | Dependent | If the path for aFileName starts with /Sys capability AllFiles is required If the path for aFileName starts with /Private and this process does not have the relevant SID capability AllFiles is required |
IMPORT_C TInt IsFileOpen(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.
|
|
Capability: | DiskAdmin |
IMPORT_C TInt CheckDisk(const TDesC &aDrive) const;
Checks the integrity of the disk on the specified drive. On FAT, this checks if a cluster number is invalid, if a cluster is allocated to more than one file entry, if an unallocated cluster is not set free, and if size of an entry is invalid.
|
|
Capability: | DiskAdmin |
IMPORT_C TInt ScanDrive(const TDesC &aDrive) const;
Checks the specified drive for errors and corrects them. Specifically, it checks if long file name entries' IDs are in sequence and short name is valid, and file's allocated clusters are not used by other files.
This does not run on the internal RAM drive, and only applies to a FAT file system.
|
|
Capability: | Dependent | If the path for aLongName starts with /Sys capability AllFiles is required If the path for aLongName starts with /Private and this process does not have the relevant SID capability AllFiles is required |
IMPORT_C TInt GetShortName(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.
|
|
Capability: | Dependent | If the path for aShortName starts with /Sys capability AllFiles is required If the path for aShortName starts with /Private and this process does not have the relevant SID capability AllFiles is required |
IMPORT_C TInt GetLongName(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.
|
|
IMPORT_C TBool GetNotifyUser();
Tests whether user notification of file read or write failure is in effect.
|
IMPORT_C void SetNotifyUser(TBool aValue);
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.
|
Capability: | Dependent | If the path for aFileName starts with /Sys capability AllFiles is required If the path for aFileName starts with /Private and this process does not have the relevant SID capability AllFiles is required |
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.
|
|
IMPORT_C TBool IsValidName(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,
|
|
EFalse
Defines the value false that is passed to a TBool typeKMaxFileName
Defines the maximum length of a filenameIMPORT_C TBool IsValidName(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,
|
|
EFalse
Defines the value false that is passed to a TBool typeKMaxFileName
Defines the maximum length of a filenameIMPORT_C TInt GetDriveName(TInt aDrive, 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.
|
|
TDriveNumber
The drive number enumerationCapability: | DiskAdmin |
IMPORT_C TInt SetDriveName(TInt aDrive, 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.
|
|
IMPORT_C TInt LoaderHeapFunction(TInt aFunction, TAny *aArg1=0, TAny *aArg2=0);
This member function is not implemented in this version of Symbian OS. It always returns KErrNotSupported.
|
|
IMPORT_C TInt SetErrorCondition(TInt anError, TInt aCount=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.
|
|
IMPORT_C TInt SetDebugRegister(TInt aVal);
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.
|
|
IMPORT_C TInt SetAllocFailure(TInt aAllocNum);
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.
|
|
IMPORT_C void DebugNotify(TInt aDrive, TUint aNotifyType, 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.
|
TRequestStatus
Indicates the completion status of a request made to a service providerIMPORT_C TInt ControlIo(TInt aDrive, TInt aCommand);
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
|
|
IMPORT_C TInt ControlIo(TInt aDrive, TInt aCommand, 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.
|
|
IMPORT_C TInt ControlIo(TInt aDrive, TInt aCommand, 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.
|
|
IMPORT_C TInt ControlIo(TInt aDrive, TInt aCommand, 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.
|
|
Capability: | DiskAdmin |
IMPORT_C TInt LockDrive(TInt aDrv, const TMediaPassword &aOld, const TMediaPassword &aNew, TBool aStr);
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.
|
|
Capability: | DiskAdmin |
IMPORT_C TInt UnlockDrive(TInt aDrv, const TMediaPassword &Pswd, TBool aStr);
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.
|
|
Capability: | DiskAdmin |
IMPORT_C TInt ClearPassword(TInt aDrv, 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.
|
|
Capability: | DiskAdmin |
IMPORT_C TInt ErasePassword(TInt aDrv);
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()
.
|
|
IMPORT_C TInt SetSessionToPrivate(TInt aDrive);
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.
|
|
IMPORT_C TInt PrivatePath(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.
|
|
IMPORT_C TInt CreatePrivatePath(TInt aDrive);
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.
|
|
IMPORT_C void StartupInitComplete(TRequestStatus &aStat);
Noifies the file server that startup initialisation is complete.
|
IMPORT_C TInt SetLocalDriveMapping(const TDesC8 &aMapping);
|
|
Capability: | DiskAdmin |
IMPORT_C TInt FinaliseDrives();
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.
|
Capability: | DiskAdmin |
IMPORT_C TInt FinaliseDrive(TInt aDriveNo, TFinaliseDrvMode aMode) 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.
|
|
Capability: | DiskAdmin |
IMPORT_C TInt SwapFileSystem(const TDesC &aOldFileSystemName, const TDesC &aNewFileSystemName, TInt aDrive) 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.
|
|
IMPORT_C TInt ReserveDriveSpace(TInt aDriveNo, TInt aSpace);
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.
|
|
IMPORT_C TInt GetReserveAccess(TInt aDriveNo);
Get exclusive access for this session to overwrite a specific disk area, which has previously been reserved via RFs::ReserveDriveSpace
|
|
IMPORT_C TInt ReleaseReserveAccess(TInt aDriveNo);
Release exclusive access for this session to overwrite a specific disk area.
|
|
IMPORT_C void NotifyDismount(TInt aDrive, TRequestStatus &aStat, TNotifyDismountMode aMode=EFsDismountRegisterClient) const;
Sets up a pending dismount notifier, the type of which is specified by TNotifyDismountMode.
EFsDismountRegisterClient - Sets up a notifier to signal the client when a dismount has been requested. EFsDismountNotifyClients - Notifies all clients (who registered using EFsDismountRegisterClient) of a pending dismount, signalling the caller when all clients have responded. EFsDismountForceDismount - Forcibly dismounts the file system without signalling any registered clients.
This API is intended to be used to allow applications and servers to commit their data to the media prior to the file system being dismounted. The application forcing the dismount should first attempt to notify all clients. If all clients don't respond in a a reaonable time, the dismount request may be cancelled, followed by a forced dismount.
Any handles left open on the file system shall be disassociated from the media. Attempts to access these resources shall return with the KErrDismounted error code.
|
IMPORT_C void NotifyDismountCancel(TRequestStatus &aStat) const;
Cancels the oustanding dismount notifier, completing with KErrCancel.
|
IMPORT_C void NotifyDismountCancel() const;
Cancel all oustanding dismount notifiers for this session, completing with KErrCancel.
IMPORT_C TInt AllowDismount(TInt aDrive) 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.
|
|
Capability: | DiskAdmin |
IMPORT_C TInt AddCompositeMount(const TDesC &aFileSystemName, TInt aLocalDriveToMount, TInt aCompositeDrive, TBool aSync)
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.
|
|
Capability: | DiskAdmin |
IMPORT_C TInt SetNotifyChange(TBool aNotifyChange);
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.
|
|
IMPORT_C TInt VolumeIOParam(TInt aDriveNo, 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.
|
|
IMPORT_C TInt FileSystemSubType(TInt aDriveNo, 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: File systems without a sub type (For example, a ROM file system), the name of the file system is returned (For example, 'Rom').
|
|
TFSName
Defines a modifiable buffer descriptor to contain a file system or file system sub type name