Symbian3/SDK/Source/GUID-DE099071-8401-5DD0-B72A-672B307463A2.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?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 xml:lang="en" id="GUID-DE099071-8401-5DD0-B72A-672B307463A2"><title>Porting with Zsh</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>Zsh has no platform security capabilities, that is, it cannot directly access the private directories on a device. However, you can make use of two library functions from the static library (<filepath>copydatafile.lib</filepath>) to copy data between public and private directories: </p> <ul><li id="GUID-923D67FF-81DA-5EE1-BFE3-3D8219436EC6"><p> <codeph>static TInt CopyDataFile::CopyToPrivateL(TDesC&amp;
             aFileName)</codeph>: This function copies data from the public directory (<filepath>c:\shellpub\&lt;SID&gt;</filepath> where <codeph>SID</codeph> refers to the Secure ID of the application) to the private directory. </p> </li> <li id="GUID-A615BD9B-90DF-5152-A20C-623225E9DCB9"><p> <codeph>static TInt CopyDataFile::CopyToPublicL(TDesC&amp;
             aFileName)</codeph>: This function copies data from the private directory to the public directory (<filepath>c:\shellpub\&lt;SID&gt;</filepath> ). </p> </li> </ul> <p>These library functions can be linked to <xref href="GUID-00FFF2B3-F8E4-5CBF-B031-240D98BB2111.dita">External Programs</xref> to copy the data under a private directory to and from a public directory, <filepath>c:\shellpub</filepath>. Note that these functions are not part of Zsh; they are in a separate library and it is not mandatory to use them. </p> <p>Using these library functions, here is one way of copying data, so that it can be accessed with Zsh: </p> <ol id="GUID-44659080-B22F-5DC0-ADE3-916358577BA6"><li id="GUID-11871E6E-B602-5088-A904-630B15B9BF79"><p>To copy the files from public directory <filepath>c:\shellpub\&lt;SID&gt;</filepath> to <filepath>\private\&lt;SID&gt;</filepath>, call the <codeph>CopyToPrivateL()</codeph> function while you start the application. </p> </li> <li id="GUID-40192D29-FAE0-50F5-9E41-2E80C6623658"><p>As the <filepath>c:\shellpub</filepath> directory is public, you can view or modify files in it from Zsh. </p> </li> <li id="GUID-BF759BA2-19CE-5213-A00B-455B52EDFAFF"><p>Each application replicates its directory structure under <filepath>c:\shellpub</filepath> starting with <filepath>&lt;SID&gt;</filepath> so that they do not overwrite private files of the same name belonging to other applications. </p> </li> <li id="GUID-958AA6F4-4DC7-5BB7-A111-2ECBBEEC8A29"><p>To copy the files from <filepath>\private\&lt;SID&gt;</filepath> to a public directory <filepath>c:\shellpub\&lt;SID&gt;</filepath>, call the <codeph>CopyToPublicL()</codeph> function while you exit the application. </p> </li> </ol> <section><title>See also</title> <p><xref href="GUID-B5696711-C79B-5239-B587-33507BF2B3BE.dita">Supported Zsh Features</xref>  </p> </section> </conbody></concept>