Symbian3/SDK/Source/GUID-3FEEFC4D-19B5-502A-8310-40646B9C34BC.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 21 Jan 2010 18:18:20 +0000
changeset 0 89d6a7a84779
permissions -rw-r--r--
Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-3FEEFC4D-19B5-502A-8310-40646B9C34BC" xml:lang="en"><title>Run
time cache settings</title><prolog><metadata><keywords/></metadata></prolog><conbody>


<p><b>Read caching </b> </p>
<p>A client, or multiple clients, may issue repeated requests to read data
from the same locality within a file. Data that has been read previously that
is still in the cache can be returned to the client without continuously re-reading
the data from the media. </p>
<p> <b>Note</b>: Read caching has little benefit when files are accessed sequentially
in large blocks, and are never re-read. </p>


<p><b>Read ahead caching </b> </p>
<p>Read ahead caching builds on read caching by detecting clients that are
performing streaming operations and speculatively reading ahead on the assumption
that, once the data is in the cache it is likely to be accessed in the near
future, thus improving performance. </p>


<p><b>Write caching </b> </p>
<p>Write caching is implemented to perform a small level of write back caching
that overcomes the inefficiencies of clients that perform small write operations
by consolidating multiple file updates into a single larger write operation,
thus taking advantage of media that is written on a block basis as well as
minimising the overhead of metadata updates that the file system performs. </p>
<section><title>Opening files with different modes</title> <p>The system is
configured by partners. Read caching, read ahead caching and write caching
are set on a per drive basis and are one of three states, these are:</p><ul>
<li><p>ON </p></li>
<li><p>ENABLED </p></li>
<li><p>OFF</p></li>
</ul><p>If caching is set to ENABLED or ON for a drive by the partner then
you, as the client, can enable or disable caching at run-time on a per file
basis. However, if caching is set to OFF it cannot be altered at run-time.
The <codeph>TFileMode</codeph> enumeration supports the run time file caching
configurations. The file open modes are as follows: </p><codeblock xml:space="preserve">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</codeblock><p>If the
values above are not specified when a file is opened then these default settings
are used:</p><ul>
<li><p>if caching is set to ENABLED for a drive by the partner then caching
is OFF by default </p></li>
<li><p>if caching is set to ON for a drive by the partner then caching is
ON by default</p></li>
</ul><note>If caching is set to OFF for a particular drive by the partner,
caching cannot be enabled.</note><p>Use the <codeph>TFileMode</codeph> values
with the following functions to alter the way in which an open file is accessed. </p><ul>
<li><p><xref href="GUID-BE0804F6-4375-3C8A-8C83-968F510466E0.dita#GUID-BE0804F6-4375-3C8A-8C83-968F510466E0/GUID-72470A68-7E07-30EF-A3C8-AA855CDAF60E"><apiname>RFile::Open()</apiname></xref></p></li>
<li><p><xref href="GUID-BE0804F6-4375-3C8A-8C83-968F510466E0.dita#GUID-BE0804F6-4375-3C8A-8C83-968F510466E0/GUID-1EB4AA8F-9363-3EC5-8AE2-1F70F15FCF15"><apiname>RFile::Create()</apiname></xref></p></li>
<li><p><xref href="GUID-BE0804F6-4375-3C8A-8C83-968F510466E0.dita#GUID-BE0804F6-4375-3C8A-8C83-968F510466E0/GUID-C2069B9B-04C0-3878-BF08-289DBC83DDF8"><apiname>RFile::Replace()</apiname></xref></p></li>
<li><p><xref href="GUID-BE0804F6-4375-3C8A-8C83-968F510466E0.dita#GUID-BE0804F6-4375-3C8A-8C83-968F510466E0/GUID-87D0C77C-CC63-3D70-BACE-3C5EE702BD37"><apiname>RFile::Temp()</apiname></xref></p></li>
</ul></section>
</conbody></concept>