1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>gfs_pio_create</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" title="gfs_pio_create">
<a name="gfs-pio-create.3"></a><div class="titlepage"></div>
<div class="refnamediv">
<a name="name"></a><h2>Name</h2>
<p>gfs_pio_create — create a file in the Gfarm file system</p>
</div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="synopsis"></a><h2>Synopsis</h2>
<div class="funcsynopsis">
<pre class="funcsynopsisinfo">
#include <gfarm/gfarm.h>
</pre>
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table">
<tr>
<td><code class="funcdef"><b class="fsfunc">gfarm_error_t gfs_pio_create</b>(</code></td>
<td>
<var class="pdparam">gfarm_url</var>, </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>
<var class="pdparam">flags</var>, </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>
<var class="pdparam">mode</var>, </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>
<var class="pdparam">gfp</var><code>)</code>;</td>
<td> </td>
</tr>
</table>
<div class="paramdef-list">
<code>const char * <var class="pdparam">gfarm_url</var></code>;<br><code>int <var class="pdparam">flags</var></code>;<br><code>gfarm_mode_t <var class="pdparam">mode</var></code>;<br><code>GFS_File * <var class="pdparam">gfp</var></code>;</div>
<div class="funcprototype-spacer"> </div>
</div>
</div>
<div class="refsect1" title="DESCRIPTION">
<a name="description"></a><h2>DESCRIPTION</h2>
<p><code class="function">gfs_pio_create()</code> creates a new file in the
Gfarm file system whose name is the
string pointed to by <em class="parameter"><code>gfarm_url</code></em> with the access mode <em class="parameter"><code>mode</code></em>,
and returns a <em class="parameter"><code>GFS_File</code></em> structure to the address pointed to by
<em class="parameter"><code>gfp</code></em>. <em class="parameter"><code>Mode</code></em> specifies the file permissions to be created,
and is modified by the process's <code class="varname">umask</code>.</p>
<p>
The
<em class="parameter"><code>flags</code></em>
argument has the same meaning as the second argument of
<code class="function">gfs_pio_open()</code>, including the point
such that exactly one of
<em class="parameter"><code>GFARM_FILE_RDONLY</code></em>,
<em class="parameter"><code>GFARM_FILE_WRONLY</code></em>, and
<em class="parameter"><code>GFARM_FILE_RDWR</code></em>
should be specified.
In addition, it is possible to specify
<em class="parameter"><code>GFARM_FILE_EXCLUSIVE</code></em>.
With this flag,
<code class="function">gfs_pio_create()</code>
will fail when the file already exists.
</p>
<p>
Note that
<em class="parameter"><code>GFARM_FILE_TRUNC</code></em>
must be explicitly specified by the
<em class="parameter"><code>flags</code></em>
argument if needed.
</p>
</div>
<div class="refsect1" title="RETURN VALUES">
<a name="return-values"></a><h2>RETURN VALUES</h2>
<div class="variablelist"><dl>
<dt><span class="term"><code class="constant">GFARM_ERR_NO_ERROR</code></span></dt>
<dd><p>The function terminated successfully.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_IS_A_DIRECTORY</code></span></dt>
<dd><p><em class="parameter"><code>gfarm_url</code></em> refers to a directory.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_IS_A_SYMBOLIC_LINK</code></span></dt>
<dd><p><em class="parameter"><code>gfarm_url</code></em> refers to a symbolic link.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_OPERATION_NOT_PERMITTED</code></span></dt>
<dd><p><em class="parameter"><code>gfarm_url</code></em> refers to not a regular file.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_NOT_A_DIRECTORY</code></span></dt>
<dd><p>A component used as a directory in <em class="parameter"><code>gfarm_url</code></em> is not, in fact, a
directory.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_PERMISSION_DENIED</code></span></dt>
<dd><p>The requested access to the file is not allowed, or one of the
directories in <em class="parameter"><code>gfarm_url</code></em> did not allow search (execute)
permission, or the file did not exist yet and write access to the
parent directory is not allowed.
Or, the authentication to the metadata server fails.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_NO_MEMORY</code></span></dt>
<dd><p>Insufficient memory was available.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_INVALID_ARGUMENT</code></span></dt>
<dd><p><em class="parameter"><code>flags</code></em>
is not valid.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_GFARM_URL_HOST_IS_MISSING</code></span></dt>
<dd><p><em class="parameter"><code>gfarm_url</code></em>
does not include a metadata server.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_GFARM_URL_PORT_IS_MISSING</code></span></dt>
<dd><p><em class="parameter"><code>gfarm_url</code></em>
does not include a port number of the metadata server.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_UNKNOWN_HOST</code></span></dt>
<dd><p>The metadata server cannot be resolved.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_TOO_MANY_OPEN_FILES</code></span></dt>
<dd><p>The process opens too many files.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEM</code></span></dt>
<dd><p>The system limit on the total number of open files has been reached.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_NETWORK_IS_UNREACHABLE</code></span></dt>
<dd><p>Network is unrechable.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_OPERATION_TIMED_OUT</code></span></dt>
<dd><p>Connetion timeout occurs.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_PROTOCOL</code></span></dt>
<dd><p>Protocol error occurs.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_BROKEN_PIPE</code></span></dt>
<dd><p>Connection to the metadata server is broken.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_PROTOCOL_NOT_SUPPORTED</code></span></dt>
<dd><p>Specified authentication protocol is not supported.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_AUTHENTICATION</code></span></dt>
<dd><p>User authentication failed when connecting to the metadata server.</p></dd>
<dt><span class="term"><code class="constant">GFARM_ERR_ALREADY_EXISTS</code></span></dt>
<dd><p><em class="parameter"><code>gfarm_url</code></em> already exists and GFARM_FILE_EXCLUSIVE was used.</p></dd>
<dt><span class="term">Others</span></dt>
<dd><p>An error except the above occurred. The reason is shown by
<span class="citerefentry"><span class="refentrytitle">gfarm_error_string</span>(3)</span>.</p></dd>
</dl></div>
</div>
<div class="refsect1" title="SEE ALSO">
<a name="see-also"></a><h2>SEE ALSO</h2>
<p>
<span class="citerefentry"><span class="refentrytitle">gfs_pio_close</span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle">gfs_pio_create</span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle">gfs_pio_eof</span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle">gfs_pio_error</span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle">gfs_pio_flush</span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle">gfs_pio_getc</span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle">gfs_pio_getline</span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle">gfs_pio_open</span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle">gfs_pio_putc</span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle">gfs_pio_putline</span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle">gfs_pio_puts</span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle">gfs_pio_read</span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle">gfs_pio_seek</span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle">gfs_pio_ungetc</span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle">gfs_pio_write</span>(3)</span>
</p>
</div>
</div></body>
</html>
|