Symbian3/SDK/Source/GUID-00FFF2B3-F8E4-5CBF-B031-240D98BB2111.dita
changeset 7 51a74ef9ed63
equal deleted inserted replaced
6:43e37759235e 7:51a74ef9ed63
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-00FFF2B3-F8E4-5CBF-B031-240D98BB2111" xml:lang="en"><title>External
       
    13 Programs</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p>External programs are executables built outside but which can be launched
       
    15 from the Zsh command prompt. </p>
       
    16 <p>If the command is neither built-in, nor specified with an absolute pathname,
       
    17 the shell will look in the <filepath>\sys\bin</filepath> on each drive in
       
    18 reverse alphabetical order (<filepath>y:</filepath>, <filepath>x:</filepath>,...
       
    19 to <filepath>b:</filepath>, <filepath>a:</filepath> and later <filepath>z:</filepath>)
       
    20 and execute the first external program found. </p>
       
    21 <p>To execute the external program directly give the following command at
       
    22 the command-prompt: </p>
       
    23 <p><userinput>command &lt;ext_pgm&gt;</userinput> </p>
       
    24 <p>where <codeph>ext_pgm</codeph> is the name of the external program. </p>
       
    25 <p>For example: </p>
       
    26 <p>The program below reads input from Zsh and writes data to Zsh which can
       
    27 then be redirected back to the Telnet client. </p>
       
    28 <codeblock id="GUID-2A92BFF9-D69D-5C18-B657-9D7D5738EA22" xml:space="preserve">#include &lt;stdio.h&gt;
       
    29 #include &lt;string.h&gt;
       
    30 #include &lt;unistd.h&gt;
       
    31 
       
    32 int  main()
       
    33     {
       
    34     char userData[20]; char ch; int x=0;
       
    35     
       
    36     memset(userData,0,20);
       
    37     x=read(0,userData, 20);    
       
    38         
       
    39     while(strcmp(userData, "quit"))
       
    40         {
       
    41         write(1, userData, x);
       
    42         memset(userData,0,20);
       
    43         x=read(0,userData, 20);        
       
    44         }        
       
    45     return 0;                 
       
    46     }
       
    47 </codeblock>
       
    48 <section id="GUID-A2C89E91-C5A5-49D9-A3A5-E9FB54A01BE1"><title>Limitations</title> <p>P.I.P.S. applications and native Symbian
       
    49 applications can be launched from the Telnet client. However, to view the
       
    50 output of the program or interact with it, the standard input and output of
       
    51 the program must be accessible to the Telnet server. This is only possible
       
    52 with P.I.P.S. applications. With native applications you will only be able
       
    53 to retrieve the termination status; you will not be able to view the output
       
    54 or interact with the program. </p> <p>Permission will be denied for external
       
    55 programs that does not have the required capabilities to access directories
       
    56 that contain <filepath>/sys</filepath> and <filepath>/private</filepath> in
       
    57 their directory path. </p> <p> <b>Note:</b> For more information about the
       
    58 external commands supported by Zsh, see the <xref href="GUID-3F577531-9798-537F-8F8B-7CAB0257560C.dita">Zsh
       
    59 Command Syntax</xref> section. </p> </section>
       
    60 <section id="GUID-164C2D77-8150-41FB-ABAB-FA1C52A59E21"><title>See also</title> <p>For information on porting Standard C
       
    61 applications to the Symbian platform see the <xref href="GUID-E2DE2C6F-E071-5E88-96F1-D71DDED84609.dita">P.I.P.S.
       
    62 Guide</xref>. </p> </section>
       
    63 </conbody></concept>