ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/xhfwrtsf.htm

254 lines
7.7 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>Exit Program for Write to Stream File (QHFWRTSF) API</title>
<!-- 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. -->
<!--File Edited November 2001 -->
<!--End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<a name="Top_of_Page"></a>
<!--Java sync-link-->
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h2>Exit Program for Write to Stream File (QHFWRTSF) API</h2>
<div class="box" style="width: 60%;">
<br>
&nbsp;&nbsp;Required Parameter Group:<br>
<!-- iddvc RMBR -->
<br>
<table width="100%">
<tr>
<td align="center" valign="top" width="10%">1</td>
<td align="left" valign="top" width="50%">Operation (WRTSF)</td>
<td align="left" valign="top" width="20%">Input</td>
<td align="left" valign="top" width="20%">Char(5)</td>
</tr>
<tr>
<td align="center" valign="top">2</td>
<td align="left" valign="top">File system job handle</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Char(16)</td>
</tr>
<tr>
<td align="center" valign="top">3</td>
<td align="left" valign="top">Open file handle</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Char(16)</td>
</tr>
<tr>
<td align="center" valign="top">4</td>
<td align="left" valign="top">Data buffer</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Char(*)</td>
</tr>
<tr>
<td align="center" valign="top">5</td>
<td align="left" valign="top">Bytes to write</td>
<td align="left" valign="top">Input</td>
<td align="left" valign="top">Binary(4)</td>
</tr>
<tr>
<td align="center" valign="top">6</td>
<td align="left" valign="top">Bytes actually written</td>
<td align="left" valign="top">Output</td>
<td align="left" valign="top">Binary(4)</td>
</tr>
</table>
<br>
</div>
<p>Before applications can use the Write to Stream File (QHFWRTSF) API with your file system, you must:</p>
<ol>
<li>Write an exit program that performs the write operation on behalf of the API. For a detailed description of the API and its calling parameters, see <a href="qhfwrtsf.htm">Write to Stream File (QHFWRTSF) API</a>.<br><br></li>
<li>Give the exit program's name when you register the file system with the Register File System (QHFRGFS) API.<br><br></li>
</ol>
<p>After that, when an application calls the QHFWRTSF API, the API calls your exit program and passes it the parameters specified by the application. Your exit program performs the work and returns any data to the API. The API passes the data back to the calling application.</p>
<br>
<!-- Please NOTE: DO NOT DELETE THIS SECTION if this API has no authorities and locks. -->
<!-- Instead, use the commented out coding below to indicate NONE. -->
<h3>Authorities and Locks</h3>
<!-- Use this if there are no authorities and locks. -->
<p>None.</p>
<br>
<h3>Required Parameter Group</h3>
<p>The following shows the input parameters that the API passes to your exit program and the output parameters that the exit program must pass back to the API:</p>
<dl>
<dt><strong>Operation (WRTSF)</strong></dt>
<dd>INPUT; CHAR(5)
<p>The abbreviation for the operation being performed (WRTSF).</p></dd>
<dt><strong>File system job handle</strong></dt>
<dd>INPUT; CHAR(16)
<p>The work area or job identifier for use by the file system.</p></dd>
</dl>
<p>The following parameters are the same as the parameters for the API.</p>
<dl>
<dt><strong>Open file handle</strong></dt>
<dd>INPUT; CHAR(16)<br><br></dd>
<dt><strong>Data buffer</strong></dt>
<dd>INPUT; CHAR(*)<br><br></dd>
<dt><strong>Bytes to write</strong></dt>
<dd>INPUT; BINARY(4)<br><br></dd>
<dt><strong>Bytes actually written</strong></dt>
<dd>OUTPUT; BINARY(4)</dd>
</dl>
<br>
<h3>API Functions</h3>
<p>The QHFWRTSF API performs the standard functions described in <a href="hfs3d.htm#HDRSTDAPI">Standard
HFS API Functions</a>.</p>
<br>
<h3>Exit Program Requirements</h3>
<p>You must create an exit program that performs the standard functions described in <a href="hfs3d.htm#HDRSTDFS">Standard HFS Exit Program Requirements</a> and these additional functions:</p>
<ul>
<li>Verifies that the file was previously opened with an access mode of write or read/write.<br><br></li>
<li>Makes sure that no part of the range of bytes being written is locked in a way that denies access to this operation.<br><br></li>
<li>Writes the number of bytes specified in the data buffer to the file, starting at the current file pointer position.<br><br></li>
<li>Records the number of bytes actually written. Unless an error occurs, this number must be the same as the number specified in the bytes-to-write parameter.<br><br></li>
<li>Increases the value of the file pointer by the number of bytes written.<br><br></li>
<li>If the write operation is not successful, sets the bytes actually written to zero and signals an exception describing the error to the API.</li>
</ul>
<br>
<h3>Error Messages for Exit Program Use</h3>
<p>This section lists the messages that the exit program can return to the API.</p>
<table cellpadding="3">
<!-- cols="15 85" -->
<tr>
<th align="left" valign="top">Message ID</th>
<th align="left" valign="top">Error Message Text</th>
</tr>
<tr>
<td align="left" valign="top">CPF1F2B E</td>
<td valign="top">Write operation not allowed to file opened for read only.</td>
</tr>
<tr>
<td align="left" valign="top">CPF1F2E E</td>
<td valign="top">Range of bytes in file in use.</td>
</tr>
<tr>
<td align="left" valign="top">CPF1F28 E</td>
<td valign="top">Damaged file.</td>
</tr>
<tr>
<td align="left" valign="top">CPF1F34 E</td>
<td valign="top">Attempted write operation beyond file size limit.</td>
</tr>
<tr>
<td align="left" valign="top">CPF1F36 E</td>
<td valign="top">Write file operation failed.</td>
</tr>
<tr>
<td align="left" valign="top">CPF1F4B E</td>
<td valign="top">Value for number of bytes not valid.</td>
</tr>
<tr>
<td align="left" valign="top">CPF1F41 E</td>
<td valign="top">Severe error occurred while addressing parameter list.</td>
</tr>
<tr>
<td align="left" valign="top">CPF1F61 E</td>
<td valign="top">No free space available on media.</td>
</tr>
<tr>
<td align="left" valign="top">CPF1F62 E</td>
<td valign="top">Requested function failed.</td>
</tr>
<tr>
<td align="left" valign="top">CPF1F63 E</td>
<td valign="top">Media is write protected.</td>
</tr>
<tr>
<td align="left" valign="top">CPF1F66 E</td>
<td valign="top">Storage needed exceeds maximum limit for user profile &amp;1.</td>
</tr>
<tr>
<td align="left" valign="top">CPF1F71 E</td>
<td valign="top">Exception specific to file system occurred.</td>
</tr>
<tr>
<td align="left" valign="top">CPF1F73 E</td>
<td valign="top">Not authorized to use command.</td>
</tr>
<tr>
<td align="left" valign="top">CPF1F74 E</td>
<td valign="top">Not authorized to object.</td>
</tr>
<tr>
<td align="left" valign="top">CPF1F77 E</td>
<td valign="top">Severe parameter error occurred on call to file system.</td>
</tr>
</table>
<br>
<hr>
Exit Program Introduced: V2R1
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a
href="hfs1.htm">Hierarchical File System APIs</a> |
<a href="aplist.htm">APIs by category</a></td>
</tr>
</table>
</center>
</body>
</html>