|
Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
|
#include <e32base.h>#include <e32svr.h>#include <e32ldr.h>#include <f32file.inl>#include <f32file_private.h>Go to the source code of this file.
Classes | |
| class | TVolumeIOParamInfo |
| Volume IO parameter information. More... | |
| class | TBlockMapEntry |
| struct | SBlockMapInfo |
| class | TEntry |
| Encapsulates an entry in a directory, which can be another (nested) directory, a file or a volume label. More... | |
| class | TEntryArray |
| Array of directory entries. More... | |
| class | TDriveInfo |
| Contains drive information. More... | |
| class | TVolumeInfo |
| Contains information about a volume mounted on a drive. More... | |
| class | TDriveUnit |
| Drive numbers and letters. More... | |
| class | TParseBase |
| Base class for file name parsing. More... | |
| class | TParsePtr |
| Parses filenames using less space on the stack than TParse. More... | |
| class | TParsePtrC |
| Parses, but cannot modify, filenames using less space on the stack than TParse. More... | |
| class | TParse |
| Parses filenames. More... | |
| class | CDir |
| Array of directory entries that has been read into memory from the file system. More... | |
| class | RFs |
| A handle to a file server session. More... | |
| class | RFs::TNameValidParam |
| This class is used to for returning meaningful error code values to users of RFs::IsValidName(const TDesC& ,TNameValidParam& ) More... | |
| class | TVolFormatParam |
| Base class for volume formatting parameters. More... | |
| class | RFile |
| Creates and opens a file, and performs all operations on a single open file. More... | |
| class | RDir |
| Reads the entries contained in a directory. More... | |
| class | RFormat |
| Formats a device, one step at a time. More... | |
| class | RRawDisk |
| Enables direct disk access. More... | |
| class | MFileManObserver |
| Provides notification of the progress of synchronous or asynchronous file management operations. More... | |
| class | CFileBase |
| Abstract base class for file management. More... | |
| class | TFindFile |
| Searches for files and directories. More... | |
| class | TOpenFileScan |
| Scans open files to get a list of the entries for all files which are currently open in a particular file server session. More... | |
| class | TFileText |
| Reads and writes single lines of text to or from a Unicode file. More... | |
Macros | |
| #define | EFSRV_EXPORT_C EXPORT_C |
| #define | EFSRV_IMPORT_C IMPORT_C |
Typedefs | |
| typedef TBuf8< KMaxDrives > | TDriveList |
| Defines a modifiable buffer descriptor to contain a drive list. | |
| typedef TBuf< KMaxDriveName > | TDriveName |
| Defines a modifiable buffer descriptor to contain a drive name. | |
| typedef TBuf< KMaxFSNameLength > | TFSName |
| Defines a modifiable buffer descriptor to contain a file system or file system sub type name. | |
| typedef TBuf8< KMaxMapsPerCall *sizeof(TBlockMapEntry)> | TBlockArrayDes |
| typedef TPckgBuf< TVolFormatParam > | TVolFormatParamBuf |
| package buffer for the objects of class TVolFormatParamBuf | |
| typedef CDir | CFileList |
| Contains a list of entries for the files which were opened in a file server session. | |
Functions | |
| __ASSERT_COMPILE (_FOFF(TVolFormatParam, iUId)==0) | |
| NONSHARABLE_CLASS (CDirScan) | |
| Scans a directory structure. | |
| NONSHARABLE_CLASS (CFileMan) | |
| Offers file management services which accept the use of wildcards; synchronous and asynchronous. | |
| NONSHARABLE_CLASS(CFsMountHelper) IMPORT_C TBool | FileNamesIdentical (const TDesC &aFileName1, const TDesC &aFileName2) |
Variables | |
| const TInt | KDefaultDrive =KMaxTInt |
| The session default drive. | |
| const TInt | KDriveAbsent =0x00 |
| Indicates a drive letter which is not in use. | |
| const TInt | KFileServerDefaultMessageSlots =-1 |
| The default value for the number of message slots passed to RFs::Connect(). | |
| const TInt | KEntryArraySize =(0x200*sizeof(TText)) |
| The size of the array of TEntry items contained in a TEntryArray object. | |
| 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. | |
| const TInt | KMaxDrives =26 |
| The maximum number of available drives. | |
| const TInt | KMaxProxyDrives =KMaxDrives-KMaxLocalDrives |
| The maximum number of available proxy drives. | |
| const TInt | KMaxDriveName =0x02 |
| The maximum length of a drivename. | |
| const TInt | KMaxFSNameLength =0x0020 |
| The maximum length of a file system name or file system sub type name. | |
| const TUint | KEntryAttNormal =0x0000 |
| File/directory attribute: any file without the hidden or system attribute. | |
| const TUint | KEntryAttReadOnly =0x0001 |
| File/directory attribute: read-only file or directory. | |
| const TUint | KEntryAttHidden =0x0002 |
| File/directory attribute: hidden file or directory. | |
| const TUint | KEntryAttSystem =0x0004 |
| File/directory attribute: system file. | |
| const TUint | KEntryAttVolume =0x0008 |
| File/directory attribute: volume name directory. | |
| const TUint | KEntryAttDir =0x0010 |
| File/directory attribute: a directory without the hidden or system attribute. | |
| const TUint | KEntryAttArchive =0x0020 |
| File/directory attribute: an archive file. | |
| const TUint | KEntryAttXIP =0x0080 |
| File/directory attribute: ROM eXecute In Place file. | |
| const TUint | KEntryAttRemote =0x0100 |
| This file attribute bit is set if the file exists only on a remote file system and is not locally cached. | |
| const TUint | KEntryAttMaskFileSystemSpecific =0x00FF0000 |
| The range of entry attributes reserved for file-system specific meanings. | |
| const TUint | KEntryAttMatchMask =(KEntryAttHidden|KEntryAttSystem|KEntryAttDir) |
| Bit mask for matching file and directory entries. | |
| const TUint | KEntryAttMaskSupported =0x3f |
| Bit mask for matching file and directory entries. | |
| const TUint | KEntryAttMatchExclusive =0x40000000 |
| Bit mask for matching file and directory entries. | |
| const TUint | KEntryAttUnique =0x01000000 |
| Bit mask for feature manager file entries. | |
| const TUint | KEntryAttMatchExclude =0x08000000 |
| Bit mask for matching file and directory entries. | |
| const TUint | KEntryAttAllowUid =0x10000000 |
| Bit mask for matching file and directory entries. | |
| const TUint | KEntryAttPacked = 0x01000000 |
| 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. | |
| const TUint | KMaxMapsPerCall = 0x8 |
| const TUint | KFileShareMask =0xff |
| Bit mask provided for retrieving a file's share mode. | |
| const TInt | KFileServerUidValue = 0x100039e3 |
| The UID of the File Server process. | |
Definition in file f32file.h.
| typedef TBuf8<KMaxMapsPerCall*sizeof(TBlockMapEntry)> TBlockArrayDes |
| 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.
| 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.
| typedef TBuf<KMaxFSNameLength> TFSName |
Defines a modifiable buffer descriptor to contain a file system or file system sub type name.
| typedef TPckgBuf<TVolFormatParam> TVolFormatParamBuf |
| enum TBlockMapUsage |
| enum TDriveNumber |
| enum TEntryKey |
Flags indicating the order in which directory entries are to be sorted.
| enum TFileCacheFlags |
Flags used to enable file server drive-specific caching.
| enum TFileManError |
A list of CFileMan error codes.
| enum TFileMode |
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:
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.
Use the following guidance notes for selecting FileShare mode with shared RFile objects:
EFileShareAny
EFileShareReadersOrWriters
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 OR’ed with either EFileStream or EFileStreamText.
Additionally, it may be OR’ed with either EFileRead or EFileWrite.
| enum TFormatMode |
The format method.
| Enumerator | |
|---|---|
| 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 | Performs a full format, erasing whole media content and creating new file system layout. This is the default mode. |
| EQuickFormat | 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 | Indicates a custom formatting mode. In this mode some optional file system specific parameters may be passed to RFormat::Open().
|
| EForceErase | Forced erase of locked media. |
| EForceFormat | 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: |
| enum TNotifyDismountMode |
Notification modes for safe media removal notification API.
| Enumerator | |
|---|---|
| EFsDismountRegisterClient | Used by a client to register for notification of pending dismount. This is the default behaviour for RFs::NotifyDismount |
| EFsDismountNotifyClients | 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 | Used to forcibly dismount the file system without notifying clients. |
| enum TNotifyType |
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.
| Enumerator | |
|---|---|
| ENotifyAll | Any change, including mounting and unmounting drives. |
| ENotifyEntry | Addition or deletion of a directory entry, or changing or formatting a disk. |
| ENotifyFile | Change resulting from file requests: RFile::Create(), RFile::Replace(), RFile::Rename(), RFs::Delete(), RFs::Replace(), and RFs::Rename(). |
| ENotifyDir | Change resulting from directory requests: RFs::MkDir(), RFs::RmDir(), and RFs::Rename(). |
| ENotifyAttributes | Change resulting from: RFs::SetEntry(), RFile::Set(), RFile::SetAtt(), RFile::SetModified() and RFile::SetSize() requests. |
| ENotifyWrite | Change resulting from the RFile::Write() request. |
| ENotifyDisk | Change resulting from the RRawDisk::Write() request. |
Commands to query specific volume information.
| Enumerator | |
|---|---|
| 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. |
| enum TSeek |
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.
| __ASSERT_COMPILE | ( | _FOFF(TVolFormatParam, iUId) | = =0 | ) |
| NONSHARABLE_CLASS(CFsMountHelper) IMPORT_C TBool FileNamesIdentical | ( | const TDesC & | aFileName1, |
| const TDesC & | aFileName2 | ||
| ) |
| 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
Defines the scan direction.
Scan upwards from the lowest level directory in the hierarchy to the top level directory.
Scan downwards from the top level directory in the hierarchy to the bottom level directory.
| 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 directory’s 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
An enumeration that identifies CFileMan tasks. This enumeration is used by CurrentAction() to identify which task currently being carried out.
Inactive
Setting attributes
Copying files
Deleting files
Moving files
Renaming files
Deleting a directory and all contents
Renaming component to VFAT short name (guaranteed to be unique)
Copying file from open file handle
Overwriting and recursion switch.
Used in CFileMan functions to set whether operations are applied to the specified directory and all directories below it, or the specified directory only.
Any files in the destination directory that have the same name as the source files in a rename, move or copy operation, will be overwritten.
Recursive operation.
This is an internal enumeration for CFileMan implementation. THis enumeration is mapped into TAction when user wants to identify the current task of CFileMan by CurrentAction().
Internal indicator for None operation. This is mapped to CFileMan::ENone.
Internal indicator for Attribs() operation. This is mapped to CFileMan::EAttribs.
Internal indicator for Copy() operation. This is mapped to CFileMan::ECopy.
Internal indicator for Delete() operation. This is mapped to CFileMan::EDelete.
Internal indicator for Move() operation on different drives. This is mapped to CFileMan::Move.
Internal indicator for Move() operation on the same drive. This is mapped to CFileMan::Rename. Note for compatibility reasons, it is not mapped to CFileMan::Move.
Internal indicator for Rename() operation. This is mapped to CFileMan::ERename.
Internal indicator for RmDir() operation. This is mapped to CFileMan::ERmDir.
Internal indicator for RenameInvalidEntry() operation. This is mapped to CFileMan::ERenameInvalidEntry.
Internal indicator for CopyFromHandle() operation. This is mapped to CFileMan::ECopyFromHandle.
| const TInt KDefaultDrive =KMaxTInt |
| const TInt KDriveAbsent =0x00 |
| const TInt KDriveDelimiter =':' |
| const TInt KEntryArraySize =(0x200*sizeof(TText)) |
The size of the array of TEntry items contained in a TEntryArray object.
| const TUint KEntryAttAllowUid =0x10000000 |
Bit mask for matching file and directory entries.
Bit mask flag used when UID information should be included in the directory entry listing.
| const TUint KEntryAttArchive =0x0020 |
| const TUint KEntryAttDir =0x0010 |
| const TUint KEntryAttHidden =0x0002 |
| const TUint KEntryAttMaskFileSystemSpecific =0x00FF0000 |
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 KEntryAttMaskSupported =0x3f |
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.
| const TUint KEntryAttMatchExclude =0x08000000 |
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:
excludes all read only entries from the directory listing.
lists only read only entries.
| const TUint KEntryAttMatchExclusive =0x40000000 |
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 OR’ed with KEntryAttDir, directories only (not hidden or system) are matched.
| const TUint KEntryAttMatchMask =(KEntryAttHidden|KEntryAttSystem|KEntryAttDir) |
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).
| const TUint KEntryAttNormal =0x0000 |
| const TUint KEntryAttPacked = 0x01000000 |
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 KEntryAttReadOnly =0x0001 |
| const TUint KEntryAttRemote =0x0100 |
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 KEntryAttSystem =0x0004 |
| const TUint KEntryAttUnique =0x01000000 |
| const TUint KEntryAttVolume =0x0008 |
| const TUint KEntryAttXIP =0x0080 |
| const TInt KExtDelimiter ='.' |
| const TInt KFileServerDefaultMessageSlots =-1 |
The default value for the number of message slots passed to RFs::Connect().
| const TInt KFileServerUidValue = 0x100039e3 |
| const TUint KFileShareMask =0xff |
| const TInt KMaxDriveName =0x02 |
| const TInt KMaxDrives =26 |
| const TInt KMaxFSNameLength =0x0020 |
| const TUint KMaxMapsPerCall = 0x8 |
| const TInt KMaxProxyDrives =KMaxDrives-KMaxLocalDrives |