<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1.2//EN"
  "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<!-- $Id$ -->

<refentry id="gfs-stat.3">

<refentryinfo><date>24 Jun 2019</date></refentryinfo>

<refmeta>
<refentrytitle>gfs_stat</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>Gfarm</refmiscinfo>
</refmeta>

<refnamediv id="name">
<refname>gfs_stat</refname>
<refpurpose>get file status</refpurpose>
</refnamediv>
<refsynopsisdiv id="synopsis">
<funcsynopsis>
<funcsynopsisinfo format="linespecific">
#include &lt;gfarm/gfarm.h&gt;
</funcsynopsisinfo>

<funcprototype>
  <funcdef><function moreinfo="none"><returnvalue>gfarm_error_t </returnvalue>gfs_stat</function></funcdef>
    <paramdef>const char * <parameter moreinfo="none">gfarm_url</parameter></paramdef>
    <paramdef>struct gfs_stat * <parameter moreinfo="none">status</parameter></paramdef>
</funcprototype>


</funcsynopsis>
</refsynopsisdiv>

<!-- body begins here -->

<refsect1 id="description"><title>DESCRIPTION</title>
<para><function moreinfo="none">gfs_stat()</function> return information about the specified file pointed
to by <parameter moreinfo="none">gfarm_url</parameter>, and fills in the buffer pointed to by
<parameter moreinfo="none">status</parameter>.  Since <parameter moreinfo="none">status</parameter> includes a pointer to dynamically
allocated memory space, it is necessary to free the memory space by
gfs_stat_free(3).</para>

</refsect1>

<refsect1 id="return-values"><title>RETURN VALUES</title>
<variablelist>
<varlistentry>
<term><constant>GFARM_ERR_NO_ERROR</constant></term>
<listitem>
<para>The function terminated successfully.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GFARM_ERR_NO_MEMORY</constant></term>
<listitem>
<para>Insufficient memory was available.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GFARM_ERR_AUTHENTICATION</constant></term>
<listitem>
<para>User authentication failed when connecting to gfmd(8).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GFARM_ERR_PERMISSION_DENIED</constant></term>
<listitem>
<para><parameter moreinfo="none">gfarm_url</parameter>
points outside your accessible address space.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GFARM_ERR_NO_SUCH_OBJECT</constant></term>
<listitem>
<para><parameter moreinfo="none">gfarm_url</parameter>
does not exist.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GFARM_ERR_NOT_A_DIRECTORY</constant></term>
<listitem>
<para>A component of the path prefix is not a directory.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Others</term>
<listitem>
<para>An error except the above occurred.  The reason is shown by
<citerefentry><refentrytitle>gfarm_error_string</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

<refsect1 id="see-also"><title>SEE ALSO</title>
<para>
<citerefentry><refentrytitle>gfs_stat_free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

