Location:
f32file.h
TFileMode
Supported from 5.0
Access and share modes available when opening a file.
The access mode indicates whether the file is opened for reading
only or writing. The share mode indicates whether other RFile
objects can access the open file, and whether this access is read only.
If a file is already open for sharing, it can only be opened by
another program using the same share mode as the one in which it was originally
opened. For example, a file opened using EFileShareReadersOnly
share mode can only be opened by another program using
EFileShareReadersOnly
mode.
So, 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,EFileWrite|EFileShareAny);
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.
Files may be opened in text or binary mode. Native EPOC
applications’ 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). EPOC
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
.
|