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

113 lines
3.6 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>creat64()--Create or Rewrite a File (Large File Enabled)</title>
<!-- Begin Header Records -->
<!-- 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. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- Unix2 SCRIPT J converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
<!-- This file has undergone html cleanup on 05/14/02 by JET -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!-- Java sync-link -->
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript">
</script>
<a name="Top_Of_Page"></a>
<h2>creat64()--Create or Rewrite a File (Large File Enabled)</h2>
<div class="box" style="width: 60%;">
<br>
&nbsp;&nbsp;Syntax<br>
<pre>
#include &lt;fcntl.h&gt;
int creat64(const char <em>*path</em>, mode_t <em>mode</em>);
</pre>
&nbsp;&nbsp;Service Program Name: QP0LLIB1<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Conditional; see <a href="#USAGE_NOTES">Usage Notes</a>.<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The <strong>creat64()</strong> function creates a new file or rewrites an
existing file so that it is truncated to zero length. The open file instance
created with <strong>creat64()</strong> is allowed to be larger than 2GB minus
1 byte. The function call</p>
<pre>
creat64(<em>path,mode</em>);
</pre>
is equivalent to the call
<pre>
open64(<em>path</em>, O_CREAT|O_WRONLY|O_TRUNC, <em>mode</em>);
</pre>
<p>If the file named by <em>path</em> does not already exist, it is created.
The file is then opened for writing only and truncated to zero length. For
further information, see <a href="open64.htm">open64()</a>--Open File (Large
File Enabled).</p>
<p>See <a href="creat64u.htm">QlgCreat64</a>--Create or Rewrite a File (Large
File Enabled) for a description and an example of supplying the <em>path</em>
in any CCSID.</p>
<p>The <em>mode</em> argument specifies file permission bits to be used in
creating the file. For more information on <em>mode</em>, see <a href=
"fchmod.htm">chmod()</a>--Change File Authorizations.</p>
<p>For additional information about parameters, authorities required, error
conditions, and examples, see <a href="creat.htm">creat()</a>--Create or
Rewrite File.</p>
<br>
<h3><a name="usage_notes">Usage Notes</a></h3>
<ol type="1">
<li>When you develop in C-based languages, the prototypes for the 64-bit APIs
are normally hidden. To use the <strong>creat64()</strong> API, you must
compile the source with _LARGE_FILE_API macro defined.<br>
<br>
</li>
<li>All of the usage notes for <strong>creat()</strong> apply to <strong>
creat64()</strong>. See <a href="creat.htm#HDRCRTUSAG">Usage Notes</a> in the
<strong>creat()</strong> API.</li>
</ol>
<hr>
API introduced: V4R4
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"unix.htm">UNIX-Type APIs</a> | <a href="aplist.htm">APIs by category</a></td>
</tr>
</table>
</center>
</body>
</html>