const TInt | KDriveAbsent |
Indicates a drive letter which is not in use.
This is useful when scanning a drive list to find which drives are available.
const TInt | KEntryArraySize |
The size of the array of TEntry items contained in a TEntryArray object.
See also: TEntryArray TEntry
const TInt | KPathDelimiter |
The character used to separate directories in the path name.
const TInt | KDriveDelimiter |
The character used to separate the drive letter from the path.
const TInt | KExtDelimiter |
The character used to separate the filename from the extension.
typedef TBuf8< KMaxDrives > | TDriveList |
Defines a modifiable buffer descriptor to contain a drive list.
The descriptor has maximum length KMaxDrives, sufficient to contain all possible drive letters.
See also: RFs::DriveList KMaxDrives
const TInt | KMaxDriveName |
The maximum length of a drivename.
Sufficient for a drive letter and colon.
typedef TBuf< KMaxDriveName > | TDriveName |
Defines a modifiable buffer descriptor to contain a drive name.
A drive name comprises a drive letter (A through Z) and a colon. KMaxDriveName (2 bytes) is sufficient for a drive letter and colon.
See also: TDriveUnit::Name KMaxDriveName
const TInt | KMaxFSNameLength |
The maximum length of a file system name or file system sub type name. 32 characters is sufficient for a file system or sub type name.
typedef TBuf< KMaxFSNameLength > | TFSName |
Defines a modifiable buffer descriptor to contain a file system or file system sub type name.
See also: KMaxFSNameLength
const TUint | KEntryAttNormal |
File/directory attribute: any file without the hidden or system attribute.
const TUint | KEntryAttReadOnly |
File/directory attribute: read-only file or directory.
const TUint | KEntryAttDir |
File/directory attribute: a directory without the hidden or system attribute.
const TUint | KEntryAttRemote |
This file attribute bit is set if the file exists only on a remote file system and is not locally cached.
Due to the potential high-latency of remote file systems, applications (or users of applications) may make use of this bit to modify their behaviour when working with remote files.
This is a read-only attribute, so any attempt to set this attribute will will be ignored.
const TUint | KEntryAttMaskFileSystemSpecific |
The range of entry attributes reserved for file-system specific meanings. File systems may assign meaning to these bits, but their definition will not be supported nor maintained by Symbian.
All other file attribute bits are reserved for use by Symbian.
The following table summarises the assignment of attribute bits:
0 - KEntryAttReadOnly 1 - KEntryAttHidden 2 - KEntryAttSystem 3 - KEntryAttVolume
4 - KEntryAttDir 6 - KEntryAttArchive 7 - KEntryAttXIP
8 - KEntryAttRemote 9 - Reserved 10 - Reserved 11 - Reserved
12 - Reserved 13 - Reserved 14 - Reserved 15 - Reserved
16 - File System Specific 17 - File System Specific 18 - File System Specific 19 - File System Specific
20 - File System Specific 22 - File System Specific 22 - File System Specific 23 - File System Specific
24 - KEntryAttPacked 25 - Reserved 26 - Reserved 27 - KEntryAttMatchExclude
28 - KEntryAttAllowUid 29 - Reserved 30 - KEntryAttMatchExclusive 31 - Reserved
const TUint | KEntryAttMatchMask |
Bit mask for matching file and directory entries.
This mask ensures that directories and hidden and system files are matched.
(Note that KEntryAttNormal matches all entry types except directories, hidden and system entries).
See also: RFs::GetDir
const TUint | KEntryAttMaskSupported |
Bit mask for matching file and directory entries.
This is used when all entry types, including hidden and system files, but excluding the volume entry are to be matched.
See also: RFs::GetDir
const TUint | KEntryAttMatchExclusive |
Bit mask for matching file and directory entries.
This is used for exclusive matching. When OR'ed with one or more file attribute constants, for example, KEntryAttNormal, it ensures that only the files with those attributes are matched. When ORed with KEntryAttDir, directories only (not hidden or system) are matched.
See also: KEntryAttDir KEntryAttNormal RFs::GetDir
const TUint | KEntryAttUnique |
Bit mask for feature manager file entries.
It is used in order to identify each ROM feature set data file uniquely in the mount order of ROM sections.
const TUint | KEntryAttMatchExclude |
Bit mask for matching file and directory entries.
It is used to exclude files or directories with certain attributes from directory listings. This bitmask has the opposite effect to KEntryAttMatchExclusive. For example:
KEntryAttMatchExclude|KEntryAttReadOnly
excludes all read only entries from the directory listing.
KEntryAttMatchExclusive|KEntryAttReadOnlylists only read only entries.
See also: KEntryAttMatchExclusive RFs::GetDir
const TUint | KEntryAttAllowUid |
Bit mask for matching file and directory entries.
Bit mask flag used when UID information should be included in the directory entry listing.
See also: RFs::GetDir
const TUint | KEntryAttPacked |
Indicates that a TEntry (that is generally returned from a TEntryArray) is stored in packed format where the iSizeHigh and iReserved fields follow the valid characters of the name string. Before accessing the aforementioned members, the entry must be unpacked.
const TUint | KMaxMapsPerCall |
A set of change notification flags.
These flags indicate the kind of change that should result in notification.
This is useful for programs that maintain displays of file lists that must be dynamically updated.
See also: RFs::NotifyChange RFs RFile RRawDisk
Enumerator | Value | Description |
---|---|---|
ENotifyAll | 0x01 |
Any change, including mounting and unmounting drives. |
ENotifyEntry | 0x02 |
Addition or deletion of a directory entry, or changing or formatting a disk. |
ENotifyFile | 0x04 |
Change resulting from file requests: RFile::Create(), RFile::Replace(), RFile::Rename(), RFs::Delete(), RFs::Replace(), and RFs::Rename(). |
ENotifyDir | 0x08 |
Change resulting from directory requests: RFs::MkDir(), RFs::RmDir(), and RFs::Rename(). |
ENotifyAttributes | 0x10 |
Change resulting from: RFs::SetEntry(), RFile::Set(), RFile::SetAtt(), RFile::SetModified() and RFile::SetSize() requests. |
ENotifyWrite | 0x20 |
Change resulting from the RFile::Write() request. |
ENotifyDisk | 0x40 |
Change resulting from the RRawDisk::Write() request. |
Enumerator | Value | Description |
---|---|---|
EFsDismountRegisterClient | 0x01 |
Used by a client to register for notification of pending dismount. This is the default behaviour for RFs::NotifyDismount |
EFsDismountNotifyClients | 0x02 |
Used for graceful file system dismounting with notifying clients of a pending dismount. If all clients have responded by RFs::AllowDismount(), the file system will be dismounted. |
EFsDismountForceDismount | 0x03 |
Used to forcibly dismount the file system without notifying clients. |
Flags used to enable file server drive-specific caching
Enumerator | Value | Description |
---|---|---|
EFileCacheReadEnabled | 0x01 |
Enable read caching - if file explicitly opened in EFileReadBuffered mode |
EFileCacheReadOn | 0x02 |
Enable read caching for all files, regardless of file open mode |
EFileCacheReadAheadEnabled | 0x04 |
Enable read-ahead caching - if file explicitly opened in EFileReadAheadOn mode |
EFileCacheReadAheadOn | 0x08 |
Enable read-ahead caching, regardless of file open mode |
EFileCacheWriteEnabled | 0x10 |
Enable write caching, if file explicitly opened in EFileWriteBuffered mode |
EFileCacheWriteOn | 0x20 |
Enable write caching for all files, regardless of file open mode |
Commands to query specific volume information, used in RFs::QueryVolumeInfoExt() API.
See also: TVolumeIOParamInfo, RFs::QueryVolumeInfoExt()
Enumerator | Value | Description |
---|---|---|
EFileSystemSubType |
Queries the sub type of the file system mounted on a specified volume. For example, FAT12, FAT16 or FAT32. | |
EIOParamInfo |
Queries the I/O parameters of a specificed volume. This includes the block size, the cluster size and the recommended read and write sizes for the media. | |
EIsDriveSync |
This command determines whether the volume is synchronous or asynchronous. A boolean value is returned within the buffer defined as TPckgBuf<TBool>. ETrue for Synchronous and EFalse for Asynchronous. | |
EIsDriveFinalised |
Query if the given drive is finalised. See RFs::FinaliseDrive() Not all file systems may support this query. A boolean value is returned within the buffer defined as TPckgBuf<TBool>. ETrue value means that the drive is finalised | |
EFSysExtensionsSupported |
Query the volume to ascertain whether File system extensions are supported on this volume. A boolean value is returned within the buffer defined as TPckgBuf<TBool>. ETrue value means that extensions are supported. EFalse means they are not supported. | |
EGetLocalDriveNumber |
Query a local drive number that corresponds to the given number of a logical drive (the one provided to the most of RFs APIs). This local drive number can be used in TBusLocalDrive API then. See TBusLocalDrive::Connect(). For example, drive C: has logical number 2 and corresponding media driver can deal with it as with _local_ drive 13. It is also possible when several logical drives correspond to one local drive and served by the same media driver. An integer value of the local drive number is returned within the buffer defined as TPckgBuf<TInt>, if the operation result is KErrNone. KErrNotReady result means that the logical drive number doesn't correspond to any of the local drives |
Flags indicating the order in which directory entries are to be sorted.
See also: RFs::GetDir CDirScan::SetScanDataL CDir::Sort
Enumerator | Value | Description |
---|---|---|
ESortNone | 0 |
The default; no sorting takes place |
ESortByName |
Sort according to alphabetic order of file and directory name. This setting is mutually exclusive with ESortByExt, ESortBySize, ESortByDate and ESortByUid. | |
ESortByExt |
Sort according to alphabetic order of file extension. Files without an extension take precedence over files with an extension. For files with the same extension or without an extension, the default is to sort by name. This setting is mutually exclusive with ESortByName, ESortBySize, ESortByDate and ESortByUid. | |
ESortBySize |
Sort according to file size. This setting is mutually exclusive with ESortByName, ESortByExt, ESortByDate and ESortByUid. | |
ESortByDate |
Sort according to files' last modified time and date. By default, most recent last. This setting is mutually exclusive with ESortByName, ESortByExt, ESortBySize and ESortByUid. | |
ESortByUid |
Sort according to file UID. This setting is mutually exclusive with ESortByName, ESortByExt, ESortBySize and ESortByDate. | |
EDirsAnyOrder | 0 |
Qualifies the sort order; if set, directories are listed in the order in which they occur. This is the default. This flag is mutually exclusive with EDirsFirst and EDirslast. |
EDirsFirst | 0x100 |
Qualifies the sort order; if set, directories come before files in sort order. This flag is mutually exclusive with EDirsAnyOrder and EDirsLast. |
EDirsLast | 0x200 |
Qualifies the sort order; if set, files come before directories in sort order. This flag is mutually exclusive with EDirsAnyOrder and EDirsFirst. |
EAscending | 0 |
Qualifies the sort order; files are sorted in ascending order, i.e. from A to Z. This is the default behaviour. This flag is mutually exclusive with EDescending and EDirDescending. |
EDescending | 0x400 |
Qualifies the sort order; files are sorted in descending order, i.e. from Z to A. This flag is mutually exclusive with EAscending and EDirDescending. |
EDirDescending | 0x800 |
Qualifies the sort order; directories are sorted in descending order, i.e. from Z to A. This flag shall be used in combination with either EDirsFirst or EDirsLast. This flag is mutually exclusive with EAscending and EDescending. |
Access and share modes available when opening a file.
The access mode indicates whether the file is opened just for reading or for writing.
The share mode indicates whether other RFile objects can access the open file, and whether this access is read only.
Use EFileShareReadersOrWriters if a client does not care whether the file has been previously opened for ReadOnly or Read/Write access.
If EFileShareReadersOrWriters is not used, then a client needs to cooperate with other clients in order to open the file with the correct share mode, either EFileShareReadersOnly or EFileShareAny, depending on the share mode used when the file was originally opened.
To open a file for reading and writing with read and write shared access, use:
_LIT(KFilename, "filename.ext"); RFile file; file.Open(theFs, KFilename, EFileShareAny|EFileWrite);
If another instance of RFile tries to open this file in EFileShareExclusive or EFileShareReadersOnly mode, access is denied. However, it can be opened in EFileShareAny mode or EFileShareReadersOrWriters mode.
If a file is opened with EFileShareReadersOrWriters, and the file is opened for sharing by another client, then the file share mode is promoted to the new share mode. When the file handle is closed then the share mode is demoted back to EFileShareReadersOrWriters.
Table of FileShare promotion rules ---------------------------------- Client A Client B Resultant Share Mode -------- -------- -------------------- ReadersOnly ReadersOnly ReadersOnly ReadersOnly ReadersOrWriters|EFileRead ReadersOnly ReadersOnly ReadersOrWriters|EFileWrite INCOMPATIBLE ReadersOnly Any INCOMPATIBLE ReadersOrWriters|EFileRead ReadersOnly ReadersOnly ReadersOrWriters|EFileRead ReadersOrWriters|EFileRead ReadersOrWriters ReadersOrWriters|EFileRead ReadersOrWriters|EFileWrite ReadersOrWriters ReadersOrWriters|EFileRead Any Any ReadersOrWriters|EFileWrite ReadersOnly INCOMPATIBLE ReadersOrWriters|EFileWrite ReadersOrWriters|EFileRead ReadersOrWriters ReadersOrWriters|EFileWrite ReadersOrWriters|EFileWrite ReadersOrWriters ReadersOrWriters|EFileWrite Any Any Any ReadersOnly INCOMPATIBLE Any ReadersOrWriters|EFileRead Any Any ReadersOrWriters|EFileWrite Any Any Any Any
Use the following guidance notes for selecting FileShare mode with shared RFile objects:
Use this mode to request both read and write access when another client needs to write to the file and respective client access to the file is coordinated.
To open a file for non-exclusive write, use EFileShareAny | EFileWrite.
It is recommended that either EFileShareAny or EFileShareAny | EFileRead are not used. These combinations will block users attempting to use the EFileShareReadersOnly mode even if all the EFileShareAny handles do not have the EFileWrite bit set as the EFileRead and EFileWrite bits have no affect on sharing. Use either EFileShareReadersOnly or EFileShareReadersOrWriters.
Use this mode when it does not matter if another file writes to the file and file access can not be coordinated as other clients are unknown.
To open a file for shared read access whilst permitting writers, use EFileShareReadersOrWriters | EFileRead.
For write access with unrestricted share mode, EFileShareReadersOrWriters | EFileWrite may be used however EFilesShareAny | EFileWrite is preferred.
Use this mode to get read access to the file and deny write access for any other handles on this file.
To open a file for shared read access whilst disallowing writers use EFileShareReadersOnly.
Files may be opened in text or binary mode. Native Symbian OS application files are nearly all binary, (so they will usually be opened in binary mode). However, they can be opened in text mode (to support testing, and to make them compatible with text formats on remote systems). Symbian OS native text format uses CR-LF (ASCII 0x0d, 0x0a) to denote the end of a line. When reading, however, any combination of CR, LF, LF-CR or CR-LF is recognised as the end of a line. Where a remote file system uses a different format, it is the responsibility of the installable file system to present an interface for text files which conforms with this format.
The share mode may be ORed with either EFileStream or EFileStreamText.
Additionally, it may be ORed with either EFileRead or EFileWrite.
Enumerator | Value | Description |
---|---|---|
EFileShareExclusive |
Exclusive access for the program opening the file. No other program can access the file until it is closed. If another program is already accessing the file in any share mode, then an attempt to open it with an EFileShareExclusive will fail. | |
EFileShareReadersOnly |
Read-only sharing. This means that the file may only be accessed for reading. A file cannot be opened using a share mode of EFileShareReadersOnly with an EFileWrite flag. | |
EFileShareAny |
Shared access for reading and writing. This means that other programs may share access to the file for reading and writing with the program which opened the file. When using this mode, the program is expecting another program to be able to write to the file, so is not compatible with EFileShareReadersOnly. | |
EFileShareReadersOrWriters |
Shared access for reading and writing. This means that other programs may share access to the file for reading and writing with the program which opened the file. When using this mode, the program does not care if another program has the file open for read or write access. | |
EFileStream | 0 |
For files to be opened in binary mode. |
EFileStreamText | 0x100 |
For files to be opened in text mode. |
EFileRead | 0 |
The file may be read from but not written to. |
EFileWrite | 0x200 |
The file may be read from and written to Cannot be combined with a share mode of EFileShareReadersOnly. |
EFileReadAsyncAll | 0x400 |
Specifies that an asynchronous read request should not be completed until all requested data becomes available. Cannot be combined with the EFileShareExclusive or EFileShareReadersOnly share modes as this will prohibit a writer from updating the file. |
EFileWriteBuffered | 0x00000800 |
Enables write buffering |
EFileWriteDirectIO | 0x00001000 |
Disables write buffering |
EFileReadBuffered | 0x00002000 |
Enables read buffering |
EFileReadDirectIO | 0x00004000 |
Disables read buffering |
EFileReadAheadOn | 0x00008000 |
Enables read ahead. |
EFileReadAheadOff | 0x00010000 |
Disables read ahead. |
EDeleteOnClose | 0x00020000 |
Enable delete on close |
EFileBigFile | 0x00040000 |
Enables operations on large files. |
EFileSequential | 0x00080000 |
Using this flag implies that the client is making large sequential reads and/or writes and it is interested in maximising the performance of the large reads and/or writes. The flag gives a hint to the file server and filesystem to adjust to a streaming data pattern and try their best to make it optimal. Some conditions apply:
If a file is opened by Client A with EFileSequential, and the file is then opened without EFileSequential by Client B, then this file mode will be disabled. When the file handle is closed by Client B, then the EFileSequential file mode will be enabled again. Therefore, this mode will only be enabled if all clients set the file as such, otherwise the file mode will be disabled. FAT file system specific information: This flag improves write and file expansion performance whilst decreasing robustness on a "Rugged-FAT" file system, which is applicable to internal non-removable drives. |
The format method.
Enumerator | Value | Description |
---|---|---|
EHighDensity |
Indicates a high density floppy disk to be formatted. Obsolete. Can be ORed with EFullFormat or EQuickFormat, but does not have any effect. | |
ELowDensity |
Indicates a low density floppy disk to be formatted. Obsolete. Can be ORed with EFullFormat or EQuickFormat, but does not have any effect. | |
EFullFormat | 0 |
Performs a full format, erasing whole media content and creating new file system layout. This is the default mode. |
EQuickFormat | 0x100 |
Performs a quick media format, erasing only required minimum media content. For example, for FAT file system it resets FAT and root directory content. Also preserves bad sectors if there are some on the volume. |
ESpecialFormat | 0x200 |
Indicates a custom formatting mode. In this mode some optional file system specific parameters may be passed to RFormat::Open().
See also: TLDFormatInfo TInt RFormat::Open(RFs &aFs, const TDesC &aName, TUint aFormatMode, TInt &aCount, const TDesC8 &anInfo); |
EForceErase | 0x400 |
Forced erase of locked media |
EForceFormat | 0x800 |
This flag enables formatting the volume even if it has files or directories opened on it. If this flag is specified, the volume will be forcedly dismounted before performing media formatting. Even with this flag the RFormat::Open() can fail with KErrInUse in following cases: 1. if there are clamped files on the volume. 2. there are opened "disk access" objects, like RFormat or RRawDisk on the volume. |
Flags indicating the destination of a seek operation.
File locations are specified as a 32-bit signed integer, allowing offsets of ?GB from the origin of the seek.
See also: RFile::Seek
Enumerator | Value | Description |
---|---|---|
ESeekAddress |
This can only be used for file systems with execute-in-place facilities, such as the ROM file system: the offset specifies the absolute address of the data. | |
ESeekStart |
Destination is the start of file. | |
ESeekCurrent |
Destination is the current position in file. | |
ESeekEnd |
Destination is the end of file. |
typedef TBuf8< KMaxMapsPerCall *sizeof(TBlockMapEntry)> | TBlockArrayDes |
Enumerator | Value | Description |
---|---|---|
EBlockMapUsagePaging | ||
ETestDebug |
__ASSERT_COMPILE | ( | _FOFF(TVolFormatParam, iUId) | = =0 | ) |
typedef TPckgBuf< TVolFormatParam > | TVolFormatParamBuf |
package buffer for the objects of class TVolFormatParamBuf
NONSHARABLE_CLASS | ( | CDirScan | ) |
Scans a directory structure.
The scan moves from directory to directory through the hierarchy, returning a list of the entries contained in each. The order in which the directories are scanned is determined by a sort key which is specified when setting up the scan. The base directory to be scanned and the entry types of interest must also be specified before performing the scan.
This class is not intended for user derivation
A list of CFileMan error codes.
See also: CFileMan
Enumerator | Value | Description |
---|---|---|
ENoExtraInformation |
No additional error information is available, either because the latest CFileMan operation did not return an error, or if it did, the error was not one for which additional information is available. | |
EInitializationFailed |
A leave occurred while setting up the initial scan. This indicates that the operation did not begin.
See also: CDirScan. | |
EScanNextDirectoryFailed |
A leave occurred while scanning the next directory in the course of a file management function. This indicates that the operation did begin.
See also: CDirScan. | |
ESrcOpenFailed |
Error occurred when attempting to open the source file for a file copy or move. | |
ETrgOpenFailed |
Error occurred while attempting to create, or, if overwriting is in effect, replace the target file for a file copy or move. | |
ENoFilesProcessed |
The operation completed without processing any files because no matching files were found. |
NONSHARABLE_CLASS | ( | CFileMan | ) |
Offers file management services which accept the use of wildcards; synchronous and asynchronous.
It also provides enquiry functions, which, like those provided by the base class CFileBase, may be used by an observer class object to provide the user with information about the progress of the operation.
All of the file management functions provided by this class accept the use of wildcards, and may operate either synchronously or asynchronously. When CFileMan is operating asynchronously, the operation takes place in a separate thread from the calling code.
A file notification observer (an instance of a class deriving from MFileManObserver) may optionally be used by CFileMan when operating synchronously or asynchronously. If provided, the appropriate notification function is called before or after each entry has been processed, or during a file copy or move. This notification can be used to provide information about the state of the operation, such as the number of bytes transferred during a large-scale file copy. It can also be used to allow the user to cancel, retry or continue processing an entry, or to abort the whole operation. If such notification is required, specify an object deriving from MFileManObserver class in the constructor, or call SetObserver(), defined in the base class, CFileBase.
All of the file manipulation functions except Rename() may operate recursively, and all can operate non-recursively. When operating recursively, these functions will act on all matching files located throughout the source directorys hierarchy. When operating non-recursively, these functions act upon files contained in the single top level source directory only. Recursion is set or unset using the switch parameter to these functions.
This class is not intended for user derivation.
Note:
To support wildcard, CFileMan needs to store the entire directory entry information. Therefore, in a extreme condition, if a directory contains a huge number of files (e.g. more than 15000 files with 10 characters' long file names), user may encounter KErrNoMemory errors. Developers who have a need to handle this rare case should increase the heap size limitation of their applications.
For more information about heap size configuration, please refer following section in Symbian Developer Library: Symbian OS build guide >> Build Tools Reference >> MMP file syntax >> epocheapsize
See also: MFileManObserver