ibm-information-center/dist/eclipse/plugins/i5OS.ic.dm_5.4.0.1/rbal3opentemp.htm

87 lines
6.7 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2005" />
<meta name="DC.rights.owner" content="(C) Copyright IBM Corporation 2005" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="Open files using temporary file descriptions" />
<meta name="abstract" content="Temporary changes can provide greater flexibility to the application. The server makes temporary changes when the program is first establishing a path to the file by opening the file." />
<meta name="description" content="Temporary changes can provide greater flexibility to the application. The server makes temporary changes when the program is first establishing a path to the file by opening the file." />
<meta name="DC.subject" content="file description, temporary changes, high-level language (HLL), temporary change, override commands, override, command, file, permanently changing, HLL (high-level language), compiler, temporarily changing, HLL (high-level language), temporary changes" />
<meta name="keywords" content="file description, temporary changes, high-level language (HLL), temporary change, override commands, override, command, file, permanently changing, HLL (high-level language), compiler, temporarily changing, HLL (high-level language), temporary changes" />
<meta name="DC.Relation" scheme="URI" content="rbal3open.htm" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rbal3opentemp" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Open files using temporary file descriptions</title>
</head>
<body id="rbal3opentemp"><a name="rbal3opentemp"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Open files using temporary file descriptions</h1>
<div><p>Temporary changes can provide greater flexibility to the application.
The server makes temporary changes when the program is first establishing
a path to the file by opening the file.</p>
<div class="p">Temporary changes can be made in one of two ways: <ul><li>By information that is specified within the program itself, and which
is passed as parameters on the open operation.</li>
<li>By using override CL commands in the input stream that is used to set
up the run-time environment for the application</li>
</ul>
</div>
<p>The ability to use the first way depends very much on which programming
language you used to write the program. Some programming languages do not
allow you to control the open process to any great extent. These languages
do the open process more or less automatically and control what information
gets passed. Other languages allow you to have greater control over the open
process.</p>
<p>You can use the second option regardless of which programming language
you use. The <span class="keyword">iSeries™ server</span> provides
override CL commands for each file type. By including override commands with
the application, you can temporarily change the file description in a file
that the program wants to use.</p>
<div class="p">You can use both options together. Information that is contained in the
application can change some parameters; an override command can change others. Both can change the same parameter. The operating system follows this order
when making temporary changes to a file: <ol><li>The file description provides a base of information.</li>
<li>Change information received from the application during the open process
is applied first to the base information.</li>
<li>Change information found in the override command is applied last. If
both the change information from the application and the override change the
same information, the override has precedence.</li>
</ol>
</div>
<p>Only the application that makes the changes can see the temporary changes. The file, as seen by another application, remains unchanged. In fact, two
applications can use the same file at the same time, and each can change it
temporarily according to its needs. Neither application is aware the other
has made a temporary change. <a href="#rbal3opentemp__rslh143">Figure 1</a> and <a href="#rbal3opentemp__rslh196">Figure 2</a> illustrate the permanent and temporary
change processes.</p>
<div class="fignone" id="rbal3opentemp__rslh143"><a name="rbal3opentemp__rslh143"><!-- --></a><span class="figcap">Figure 1. Permanently changing a File</span><br /><img src="rslh143.gif" alt="The process for permanently&#xA;changing a file." /><br /></div>
<div class="fignone" id="rbal3opentemp__rslh196"><a name="rbal3opentemp__rslh196"><!-- --></a><span class="figcap">Figure 2. Temporarily changing a File</span><br /><img src="rslh196.gif" alt="The process for temporarily&#xA;changing a file." /><br /></div>
<p>Once an application establishes a connection between itself and the file
by opening the file, it can then proceed to use the file for either input
or output operations. In the case of a database file, the open process establishes
a path between the application and the actual database file. For device files,
a path is established between the application and the actual device, or to
a spooled file if the spooling attribute is active for the device file. In
all cases, the application connects to what it wants to use, and those connections
determine what input or output operations are valid. Not all operations are
valid with all file types. The application must be aware of what file types
it uses and then use only those operations which are valid for those types.</p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbal3open.htm" title="When you want an application to use a file, you do so by referring to that file by name. The file description for that file will then control how the program and the server will interact.">Open files</a></div>
</div>
</div>
</body>
</html>