blob: 67f1c82b091d090c125c036a74a7da8fc6ee09f1 [file] [log] [blame] [view]
<link rel="stylesheet" href="../style.css" />
[TOC]
# fuchsia.io
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 7</span></div>
## **PROTOCOLS**
## AdvisoryLocking {#AdvisoryLocking}
*Defined in [fuchsia.io/locking.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/locking.fidl;l=20)*
<p>Advisory locking protocol.</p>
<p>This protocol is intended to be composed into the |File| protocol to
provide support for advisory locking.</p>
<p>Advisory locks are purely advisory. They do not prevent actual read or
write operations from occurring on the file, either through this
connection or through other connections.</p>
<p>These primitives are designed to support the flock() and fcntl(),
specifically F_SETLK, F_SETLKW, and F_GETLK, functionality that code
running on Fuchsia expects from other operating systems.</p>
### AdvisoryLock {#AdvisoryLocking.AdvisoryLock}
<p>Acquires an advisory lock on the underlying file.</p>
<p>The lock lasts until either this connection is closed or
this method is called with |AdvisoryLockType.UNLOCK| to release the lock
explicitly.</p>
<p>Advisory locks are purely advisory. They do not prevent actual read or
write operations from occurring on the file, either through this
connection or through other connections.</p>
<p>This method requires the following rights:</p>
<ul>
<li><a class='link' href='#Rights.READ_BYTES'>Rights.READ_BYTES</a> if <code>request.type</code> is <a class='link' href='#AdvisoryLockType.READ'>AdvisoryLockType.READ</a>.</li>
<li><a class='link' href='#Rights.WRITE_BYTES'>Rights.WRITE_BYTES</a> if <code>request.type</code> is
<a class='link' href='#AdvisoryLockType.WRITE'>AdvisoryLockType.WRITE</a>.</li>
</ul>
<h1>Errors</h1>
<ul>
<li><code>ZX_ERR_BAD_STATE</code> The specified type of lock cannot be acquired. For
example, another connection might hold a conflicting lock type.</li>
<li><code>ZX_ERR_NOT_SUPPORTED</code> This file does not support advisory locking.</li>
<li><code>ZX_ERR_ACCESS_DENIED</code> This connection does not have sufficient rights
to acquire the given type of lock.</li>
</ul>
#### Request {#AdvisoryLocking.AdvisoryLock_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>request</code></td>
<td>
<code><a class='link' href='#AdvisoryLockRequest'>AdvisoryLockRequest</a></code>
</td>
</tr>
</table>
#### Response {#AdvisoryLocking.AdvisoryLock_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#AdvisoryLocking_AdvisoryLock_Result'>AdvisoryLocking_AdvisoryLock_Result</a></code>
</td>
</tr>
</table>
## Directory {#Directory}
*Defined in [fuchsia.io/directory.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory.fidl;l=176)*
### AddInotifyFilter {#Directory.AddInotifyFilter}
<p>Adds a new inotify filter for an object relative to this directory object.</p>
<ul>
<li>
<p>'filter` is a mask of different inotify events that need to be watched by the server
for a specific file/directory.</p>
</li>
<li>
<p><code>path</code> may contain multiple segments, separated by &quot;/&quot; characters,
and should never be empty; i.e., &quot;&quot; is an invalid path. Paths should not contain
a leading &quot;/&quot;.</p>
</li>
</ul>
<p>+<code>watch_descriptor</code> is client assigned value to identify a filter.
Server shouldn't trust the client-assigned watch_descriptor. They should just send it
back to the client in the socket.
This value is not used by server, but it is returned back as part of InotifyEvent,
to help the client correlate filter with events on this filter.</p>
<ul>
<li><code>socket</code> is shared between different filter objects i.e every new filter will
have a different server end of the socket and there will be a single client end per
inotify instance on inotify init.</li>
</ul>
#### Request {#Directory.AddInotifyFilter_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>path</code></td>
<td>
<code><a class='link' href='#Path'>Path</a></code>
</td>
</tr>
<tr>
<td><code>filter</code></td>
<td>
<code><a class='link' href='#InotifyWatchMask'>InotifyWatchMask</a></code>
</td>
</tr>
<tr>
<td><code>watch_descriptor</code></td>
<td>
<code>uint32</code>
</td>
</tr>
<tr>
<td><code>socket</code></td>
<td>
<code>handle&lt;socket&gt;</code>
</td>
</tr>
</table>
#### Response {#Directory.AddInotifyFilter_Response}
&lt;EMPTY&gt;
### AdvisoryLock {#Directory.AdvisoryLock}
<p>Acquires an advisory lock on the underlying file.</p>
<p>The lock lasts until either this connection is closed or
this method is called with |AdvisoryLockType.UNLOCK| to release the lock
explicitly.</p>
<p>Advisory locks are purely advisory. They do not prevent actual read or
write operations from occurring on the file, either through this
connection or through other connections.</p>
<p>This method requires the following rights:</p>
<ul>
<li><a class='link' href='#Rights.READ_BYTES'>Rights.READ_BYTES</a> if <code>request.type</code> is <a class='link' href='#AdvisoryLockType.READ'>AdvisoryLockType.READ</a>.</li>
<li><a class='link' href='#Rights.WRITE_BYTES'>Rights.WRITE_BYTES</a> if <code>request.type</code> is
<a class='link' href='#AdvisoryLockType.WRITE'>AdvisoryLockType.WRITE</a>.</li>
</ul>
<h1>Errors</h1>
<ul>
<li><code>ZX_ERR_BAD_STATE</code> The specified type of lock cannot be acquired. For
example, another connection might hold a conflicting lock type.</li>
<li><code>ZX_ERR_NOT_SUPPORTED</code> This file does not support advisory locking.</li>
<li><code>ZX_ERR_ACCESS_DENIED</code> This connection does not have sufficient rights
to acquire the given type of lock.</li>
</ul>
#### Request {#Directory.AdvisoryLock_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>request</code></td>
<td>
<code><a class='link' href='#AdvisoryLockRequest'>AdvisoryLockRequest</a></code>
</td>
</tr>
</table>
#### Response {#Directory.AdvisoryLock_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#AdvisoryLocking_AdvisoryLock_Result'>AdvisoryLocking_AdvisoryLock_Result</a></code>
</td>
</tr>
</table>
### Clone {#Directory.Clone}
<p>Create another connection to the same remote object.</p>
<p><code>flags</code> may be any of:</p>
<ul>
<li><code>OpenFlags.RIGHT_*</code></li>
<li><code>OpenFlags.APPEND</code></li>
<li><code>OpenFlags.DESCRIBE</code></li>
<li><code>OpenFlags.CLONE_SAME_RIGHTS</code></li>
</ul>
<p>All other flags are ignored.</p>
<p>The <code>OpenFlags.RIGHT_*</code> bits in <code>flags</code> request corresponding rights over the resulting
cloned object.
The cloned object must have rights less than or equal to the original object, otherwise
returns <code>ZX_ERR_ACCESS_DENIED</code>.
Alternatively, pass <code>OpenFlags.CLONE_SAME_RIGHTS</code> to inherit the rights on the source connection.
It is invalid to pass any of the <code>OpenFlags.RIGHT_*</code> flags together with
<code>OpenFlags.CLONE_SAME_RIGHTS</code>.</p>
#### Request {#Directory.Clone_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
<tr>
<td><code>object</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Node'>Node</a>&gt;</code>
</td>
</tr>
</table>
### Close {#Directory.Close}
<p>Terminates the connection.</p>
<p>After calling <code>Close</code>, the client must not send any other requests.</p>
<p>Servers, after sending the status response, should close the connection
regardless of status and without sending an epitaph.</p>
<p>Closing the client end of the channel should be semantically equivalent
to calling <code>Close</code> without knowing when the close has completed or its
status.</p>
#### Request {#Directory.Close_Request}
&lt;EMPTY&gt;
#### Response {#Directory.Close_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='../fuchsia.unknown/'>fuchsia.unknown</a>/<a class='link' href='../fuchsia.unknown/#Closeable_Close_Result'>Closeable_Close_Result</a></code>
</td>
</tr>
</table>
### Enumerate {#Directory.Enumerate}
<p>Initiates a directory listing operation over the input channel,
starting at seek offset 0.</p>
<p>This method requires the <a class='link' href='#Rights.ENUMERATE'>Rights.ENUMERATE</a> right. If this right is
absent, <code>iterator</code> will be closed with a <code>ZX_ERR_ACCESS_DENIED</code> epitaph.</p>
#### Request {#Directory.Enumerate_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>options</code></td>
<td>
<code><a class='link' href='#DirectoryEnumerateOptions'>DirectoryEnumerateOptions</a></code>
</td>
</tr>
<tr>
<td><code>iterator</code></td>
<td>
<code>server_end&lt;<a class='link' href='#DirectoryIterator'>DirectoryIterator</a>&gt;</code>
</td>
</tr>
</table>
### GetAttr {#Directory.GetAttr}
<p>Acquires information about the node.</p>
<p>This method does not require any rights.</p>
#### Request {#Directory.GetAttr_Request}
&lt;EMPTY&gt;
#### Response {#Directory.GetAttr_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>attributes</code></td>
<td>
<code><a class='link' href='#NodeAttributes'>NodeAttributes</a></code>
</td>
</tr>
</table>
### GetAttributes {#Directory.GetAttributes}
<p>Acquires information about the node.</p>
<p>The attributes of a node should be stable, independent of the
specific protocol used to access it.</p>
<p>If a particular attribute is not applicable or not supported,
filesystems should leave the corresponding field absent.</p>
<ul>
<li><code>query</code> a bit-mask specifying which attributes to fetch. The server
should not return more than necessary.</li>
</ul>
<ul>
<li><code>attributes</code> the returned attributes.</li>
</ul>
<p>This method requires the <a class='link' href='#Rights.GET_ATTRIBUTES'>Rights.GET_ATTRIBUTES</a> right.</p>
#### Request {#Directory.GetAttributes_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>query</code></td>
<td>
<code><a class='link' href='#NodeAttributesQuery'>NodeAttributesQuery</a></code>
</td>
</tr>
</table>
#### Response {#Directory.GetAttributes_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Node2_GetAttributes_Result'>Node2_GetAttributes_Result</a></code>
</td>
</tr>
</table>
### GetConnectionInfo {#Directory.GetConnectionInfo}
<p>Acquires information about the connection.</p>
<p>This method does not require any rights.</p>
#### Request {#Directory.GetConnectionInfo_Request}
&lt;EMPTY&gt;
#### Response {#Directory.GetConnectionInfo_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#ConnectionInfo'>ConnectionInfo</a></code>
</td>
</tr>
</table>
### GetFlags {#Directory.GetFlags}
<p>Acquires the <code>Directory.Open</code> rights and flags used to access this file.</p>
<p>This method does not require any rights.</p>
#### Request {#Directory.GetFlags_Request}
&lt;EMPTY&gt;
#### Response {#Directory.GetFlags_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
</table>
### GetToken {#Directory.GetToken}
<p>Acquires a token to a Directory which can be used to identify access to it at a later point
in time. The token will remain valid for as long as the connection requesting the token
remains open.</p>
<p>This method requires following rights: <code>OpenFlags.RIGHT_WRITABLE</code>, otherwise returns
<code>ZX_ERR_BAD_HANDLE</code>.</p>
#### Request {#Directory.GetToken_Request}
&lt;EMPTY&gt;
#### Response {#Directory.GetToken_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>token</code></td>
<td>
<code>handle&lt;handle&gt;?</code>
</td>
</tr>
</table>
### Link {#Directory.Link}
<p>Creates a link to an object named src by the name dst, within a directory represented by
token.</p>
<p><code>src</code> must be a resolved object name. Including &quot;/&quot; in the string will
return <code>ZX_ERR_INVALID_ARGS</code>.</p>
<p><code>dst</code> must be a resolved object name. Including &quot;/&quot; in the string will
return <code>ZX_ERR_INVALID_ARGS</code>.</p>
<p>This method requires following rights: <code>OpenFlags.RIGHT_WRITABLE</code>, otherwise returns
<code>ZX_ERR_BAD_HANDLE</code>.</p>
#### Request {#Directory.Link_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>src</code></td>
<td>
<code>string[255]</code>
</td>
</tr>
<tr>
<td><code>dst_parent_token</code></td>
<td>
<code>handle&lt;handle&gt;</code>
</td>
</tr>
<tr>
<td><code>dst</code></td>
<td>
<code>string[255]</code>
</td>
</tr>
</table>
#### Response {#Directory.Link_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
### OnOpen {#Directory.OnOpen}
<p>An event produced eagerly by a FIDL server if requested by <code>OpenFlags.DESCRIBE</code>.</p>
<p>Indicates the success or failure of the open operation, and optionally describes the
object. If the status is <code>ZX_OK</code>, <code>info</code> contains descriptive information about the object
(the same as would be returned by <code>Describe</code>).</p>
#### Response {#Directory.OnOpen_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>info</code></td>
<td>
<code><a class='link' href='#NodeInfoDeprecated'>NodeInfoDeprecated</a>?</code>
</td>
</tr>
</table>
### OnRepresentation {#Directory.OnRepresentation}
<p>An event produced eagerly by the server if requested by
<a class='link' href='#NodeFlags.GET_REPRESENTATION'>NodeFlags.GET_REPRESENTATION</a>. This event will be the first message
from the server, and is sent exactly once.</p>
<p>The active variant corresponds to one of the supported protocols of
the node, and represents the result of the connection-time
negotiation. Provides auxiliary handles if applicable.</p>
<p>If the client specified more than one protocol in <code>protocols</code> during
<a class='link' href='#Directory.Open'>Directory.Open</a>, the <a class='link' href='#Representation'>Representation</a> carries additionally the
result of the connection-time negotiation via its tag.</p>
<p>The elements have one-to-one correspondence with the members of
<a class='link' href='#NodeProtocolKinds'>NodeProtocolKinds</a>.</p>
<p>This is a special case of <a class='link' href='../fuchsia.unknown/'>fuchsia.unknown</a>/<a class='link' href='../fuchsia.unknown/#Queryable.Query'>Queryable.Query</a> +
inherent <code>Describe</code> methods on the specific protocols. It exists as
an optimization to avoid an additional round trip.</p>
#### Response {#Directory.OnRepresentation_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#Representation'>Representation</a></code>
</td>
</tr>
</table>
### Open {#Directory.Open}
<p>Opens a new object relative to this directory object.</p>
<p><code>path</code> may contain multiple segments, separated by &quot;/&quot; characters, and should never be
empty; i.e. &quot;&quot; is an invalid path. A trailing slash implies OpenFlags.DIRECTORY. Components
must not be empty (i.e. &quot;foo//bar&quot; is invalid). &quot;..&quot; is disallowed anywhere in the path. &quot;.&quot;
is only allowed if the path is exactly &quot;.&quot;, but not otherwise. A leading '/' is allowed (and
is treated the same way as if not present, i.e. &quot;/foo/bar' and &quot;foo/bar&quot; are the same).</p>
<p>If an unknown value is sent for flags the connection should be closed.</p>
<p><code>OpenFlags.RIGHT_*</code> flags provided in <code>flags</code> will restrict access rights on
the <code>object</code> channel which will be connected to the opened entity.</p>
<p>Rights are never increased. When you open a nested entity within a directory, you may only
request the same rights as what the directory connection already has, or a subset of those.
Exceeding those rights causes an access denied error to be transmitted in the
<code>OnOpen</code> event if applicable, and the <code>object</code> connection closed.</p>
<p><code>mode</code> is ignored.</p>
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 12</span></div>
#### Request {#Directory.Open_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
<tr>
<td><code>mode</code></td>
<td>
<code><a class='link' href='#ModeType'>ModeType</a></code>
</td>
</tr>
<tr>
<td><code>path</code></td>
<td>
<code>string[4095]</code>
</td>
</tr>
<tr>
<td><code>object</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Node'>Node</a>&gt;</code>
</td>
</tr>
</table>
### Open2 {#Directory.Open2}
<p>Opens or creates a new node relative to this directory node.</p>
<p>This method requires the following rights on the current connection:</p>
<ul>
<li><a class='link' href='#Rights.ENUMERATE'>Rights.ENUMERATE</a></li>
<li><a class='link' href='#Rights.TRAVERSE'>Rights.TRAVERSE</a></li>
</ul>
<p>Errors are presented as an epitaph on the <code>object_request</code> channel.</p>
<ul>
<li>error <code>ZX_ERR_ACCESS_DENIED</code> if the requested rights exceeds
what is allowed.</li>
<li>error <code>ZX_ERR_BAD_PATH</code> if <code>path</code> is invalid.</li>
</ul>
#### Request {#Directory.Open2_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>path</code></td>
<td>
<code><a class='link' href='#Path'>Path</a></code>
</td>
</tr>
<tr>
<td><code>protocols</code></td>
<td>
<code><a class='link' href='#ConnectionProtocols'>ConnectionProtocols</a></code>
</td>
</tr>
<tr>
<td><code>object_request</code></td>
<td>
<code>handle&lt;channel&gt;</code>
</td>
</tr>
</table>
### Query {#Directory.Query}
#### Request {#Directory.Query_Request}
&lt;EMPTY&gt;
#### Response {#Directory.Query_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>protocol</code></td>
<td>
<code>vector&lt;uint8&gt;</code>
</td>
</tr>
</table>
### QueryFilesystem {#Directory.QueryFilesystem}
<p>Query the filesystem for filesystem-specific information.</p>
#### Request {#Directory.QueryFilesystem_Request}
&lt;EMPTY&gt;
#### Response {#Directory.QueryFilesystem_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>info</code></td>
<td>
<code><a class='link' href='#FilesystemInfo'>FilesystemInfo</a>?</code>
</td>
</tr>
</table>
### ReadDirents {#Directory.ReadDirents}
<p>Reads a collection of variably sized dirents into a buffer.
The number of dirents in a directory may be very large: akin to
calling read multiple times on a file, directories have a seek
offset which is updated on subsequent calls to ReadDirents.
Each call to ReadDirents will only return whole dirent structures,
they will not get split across ReadDirent calls. When the seek
offset reaches the end, <code>dirents</code> will be empty.</p>
<p>These dirents are of the form:</p>
<pre><code>struct dirent {
// Describes the inode of the entry.
uint64 ino;
// Describes the length of the dirent name in bytes.
uint8 size;
// Describes the type of the entry. Aligned with the
// POSIX d_type values. Use `DirentType` constants.
uint8 type;
// Unterminated name of entry.
char name[0];
}
</code></pre>
<p>This method does not require any rights, since one could always probe for
directory contents by triggering name conflicts during file creation.</p>
#### Request {#Directory.ReadDirents_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>max_bytes</code></td>
<td>
<code>uint64</code>
</td>
</tr>
</table>
#### Response {#Directory.ReadDirents_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>dirents</code></td>
<td>
<code>vector&lt;uint8&gt;[8192]</code>
</td>
</tr>
</table>
### Rename {#Directory.Rename}
<p>Renames a node named <code>src</code> to the name <code>dst</code>, in a directory represented
by <code>dst_parent_token</code>.</p>
<p><code>src</code> and <code>dst</code> must be valid node names.
See <a class='link' href='#Name'>Name</a> for what constitutes a valid name.</p>
<p>This method requires the following rights on both the current
connection, and the connection identified by <code>dst_parent_token</code>:</p>
<ul>
<li>
<p><a class='link' href='#Rights.ENUMERATE'>Rights.ENUMERATE</a></p>
</li>
<li>
<p><a class='link' href='#Rights.MODIFY_DIRECTORY'>Rights.MODIFY_DIRECTORY</a></p>
</li>
<li>
<p>error <code>ZX_ERR_INVALID_ARGS</code> if <code>src</code> or <code>dst</code> is invalid.</p>
</li>
</ul>
#### Request {#Directory.Rename_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>src</code></td>
<td>
<code><a class='link' href='#Name'>Name</a></code>
</td>
</tr>
<tr>
<td><code>dst_parent_token</code></td>
<td>
<code><a class='link' href='#Token'>Token</a></code>
</td>
</tr>
<tr>
<td><code>dst</code></td>
<td>
<code><a class='link' href='#Name'>Name</a></code>
</td>
</tr>
</table>
#### Response {#Directory.Rename_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Directory2_Rename_Result'>Directory2_Rename_Result</a></code>
</td>
</tr>
</table>
### Reopen {#Directory.Reopen}
<p>Creates another connection to the same node.</p>
<ul>
<li><code>object_request</code> is the server end of a channel created for the new
connection. The caller may proceed to send messages on the
corresponding client end right away.</li>
</ul>
#### Request {#Directory.Reopen_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>rights_request</code></td>
<td>
<code><a class='link' href='#RightsRequest'>RightsRequest</a>?</code>
</td>
</tr>
<tr>
<td><code>object_request</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Node'>Node</a>&gt;</code>
</td>
</tr>
</table>
### Rewind {#Directory.Rewind}
<p>Resets the directory seek offset.</p>
<p>This method does not require any rights, similar to ReadDirents.</p>
#### Request {#Directory.Rewind_Request}
&lt;EMPTY&gt;
#### Response {#Directory.Rewind_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
### SetAttr {#Directory.SetAttr}
<p>Updates information about the node.</p>
<p>This method requires following rights: <code>OpenFlags.RIGHT_WRITABLE</code>, otherwise returns
<code>ZX_ERR_BAD_HANDLE</code>.</p>
#### Request {#Directory.SetAttr_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#NodeAttributeFlags'>NodeAttributeFlags</a></code>
</td>
</tr>
<tr>
<td><code>attributes</code></td>
<td>
<code><a class='link' href='#NodeAttributes'>NodeAttributes</a></code>
</td>
</tr>
</table>
#### Response {#Directory.SetAttr_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
### SetFlags {#Directory.SetFlags}
<p>Changes the <code>Directory.Open</code> flags used to access the file.
Supported flags which can be turned on / off:</p>
<ul>
<li><code>OpenFlags.APPEND</code></li>
</ul>
<p>This method does not require any rights.</p>
#### Request {#Directory.SetFlags_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
</table>
#### Response {#Directory.SetFlags_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
### Sync {#Directory.Sync}
<p>Synchronizes updates to the node to the underlying media, if it exists.</p>
<p>This method will return when the filesystem server has flushed the
relevant updates to the underlying media, but does not guarantee the
underlying media has persisted the information, nor that any information
is committed to hardware. Clients may use <code>Sync</code> to ensure ordering
between operations.</p>
<p>This method does not require any rights.</p>
#### Request {#Directory.Sync_Request}
&lt;EMPTY&gt;
#### Response {#Directory.Sync_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Node2_Sync_Result'>Node2_Sync_Result</a></code>
</td>
</tr>
</table>
### Unlink {#Directory.Unlink}
<p>Removes a child node from the this directory's list of entries.</p>
<p>Note: this does not guarantee that the underlying object is destroyed.
Although the link will be removed from the containing directory,
objects with multiple references (such as files which are still open)
will not actually be destroyed until all references are closed.</p>
<ul>
<li>error <code>ZX_ERR_ACCESS_DENIED</code> if the connection does not have
<a class='link' href='#Rights.WRITE_BYTES'>Rights.WRITE_BYTES</a>.</li>
<li>error <code>ZX_ERR_NOT_SUPPORTED</code> if the underlying filesystem does not
support writing.</li>
<li>error <code>ZX_ERR_BAD_PATH</code> if <code>name</code> is invalid.</li>
<li>error <code>ZX_ERR_NOT_EMPTY</code> if <code>name</code> refers to a non-empty directory.</li>
<li>error <code>ZX_ERR_UNAVAILABLE</code> if <code>name</code> refers to a mount point,
containing a remote channel.</li>
<li>error <code>ZX_ERR_NOT_DIR</code> if the options requested a directory but
something other than a directory was found.</li>
</ul>
<p>Other errors may be returned for filesystem-specific reasons.</p>
<p>This method requires the following rights:</p>
<ul>
<li><a class='link' href='#Rights.ENUMERATE'>Rights.ENUMERATE</a></li>
<li><a class='link' href='#Rights.MODIFY_DIRECTORY'>Rights.MODIFY_DIRECTORY</a></li>
</ul>
#### Request {#Directory.Unlink_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>name</code></td>
<td>
<code><a class='link' href='#Name'>Name</a></code>
</td>
</tr>
<tr>
<td><code>options</code></td>
<td>
<code><a class='link' href='#UnlinkOptions'>UnlinkOptions</a></code>
</td>
</tr>
</table>
#### Response {#Directory.Unlink_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Directory2_Unlink_Result'>Directory2_Unlink_Result</a></code>
</td>
</tr>
</table>
### UpdateAttributes {#Directory.UpdateAttributes}
<p>Updates information about the node.</p>
<ul>
<li><code>attributes</code> the presence of a table field in <code>attributes</code> indicates
the intent to update the corresponding attribute.</li>
</ul>
<p>This method requires the <a class='link' href='#Rights.UPDATE_ATTRIBUTES'>Rights.UPDATE_ATTRIBUTES</a> right.</p>
#### Request {#Directory.UpdateAttributes_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#MutableNodeAttributes'>MutableNodeAttributes</a></code>
</td>
</tr>
</table>
#### Response {#Directory.UpdateAttributes_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Node2_UpdateAttributes_Result'>Node2_UpdateAttributes_Result</a></code>
</td>
</tr>
</table>
### Watch {#Directory.Watch}
<p>Watches a directory, receiving events of added messages on the
watcher request channel.</p>
<p>Options must be zero; it is reserved.</p>
<p>This method does not require any rights, similar to ReadDirents.</p>
#### Request {#Directory.Watch_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>mask</code></td>
<td>
<code><a class='link' href='#WatchMask'>WatchMask</a></code>
</td>
</tr>
<tr>
<td><code>options</code></td>
<td>
<code>uint32</code>
</td>
</tr>
<tr>
<td><code>watcher</code></td>
<td>
<code>server_end&lt;<a class='link' href='#DirectoryWatcher'>DirectoryWatcher</a>&gt;</code>
</td>
</tr>
</table>
#### Response {#Directory.Watch_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
## Directory1 {#Directory1}
*Defined in [fuchsia.io/directory.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory.fidl;l=241)*
<p>Directory defines a node which is capable of containing other Objects.</p>
### Clone {#Directory1.Clone}
<p>Create another connection to the same remote object.</p>
<p><code>flags</code> may be any of:</p>
<ul>
<li><code>OpenFlags.RIGHT_*</code></li>
<li><code>OpenFlags.APPEND</code></li>
<li><code>OpenFlags.DESCRIBE</code></li>
<li><code>OpenFlags.CLONE_SAME_RIGHTS</code></li>
</ul>
<p>All other flags are ignored.</p>
<p>The <code>OpenFlags.RIGHT_*</code> bits in <code>flags</code> request corresponding rights over the resulting
cloned object.
The cloned object must have rights less than or equal to the original object, otherwise
returns <code>ZX_ERR_ACCESS_DENIED</code>.
Alternatively, pass <code>OpenFlags.CLONE_SAME_RIGHTS</code> to inherit the rights on the source connection.
It is invalid to pass any of the <code>OpenFlags.RIGHT_*</code> flags together with
<code>OpenFlags.CLONE_SAME_RIGHTS</code>.</p>
#### Request {#Directory1.Clone_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
<tr>
<td><code>object</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Node'>Node</a>&gt;</code>
</td>
</tr>
</table>
### GetAttr {#Directory1.GetAttr}
<p>Acquires information about the node.</p>
<p>This method does not require any rights.</p>
#### Request {#Directory1.GetAttr_Request}
&lt;EMPTY&gt;
#### Response {#Directory1.GetAttr_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>attributes</code></td>
<td>
<code><a class='link' href='#NodeAttributes'>NodeAttributes</a></code>
</td>
</tr>
</table>
### GetFlags {#Directory1.GetFlags}
<p>Acquires the <code>Directory.Open</code> rights and flags used to access this file.</p>
<p>This method does not require any rights.</p>
#### Request {#Directory1.GetFlags_Request}
&lt;EMPTY&gt;
#### Response {#Directory1.GetFlags_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
</table>
### GetToken {#Directory1.GetToken}
<p>Acquires a token to a Directory which can be used to identify access to it at a later point
in time. The token will remain valid for as long as the connection requesting the token
remains open.</p>
<p>This method requires following rights: <code>OpenFlags.RIGHT_WRITABLE</code>, otherwise returns
<code>ZX_ERR_BAD_HANDLE</code>.</p>
#### Request {#Directory1.GetToken_Request}
&lt;EMPTY&gt;
#### Response {#Directory1.GetToken_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>token</code></td>
<td>
<code>handle&lt;handle&gt;?</code>
</td>
</tr>
</table>
### Link {#Directory1.Link}
<p>Creates a link to an object named src by the name dst, within a directory represented by
token.</p>
<p><code>src</code> must be a resolved object name. Including &quot;/&quot; in the string will
return <code>ZX_ERR_INVALID_ARGS</code>.</p>
<p><code>dst</code> must be a resolved object name. Including &quot;/&quot; in the string will
return <code>ZX_ERR_INVALID_ARGS</code>.</p>
<p>This method requires following rights: <code>OpenFlags.RIGHT_WRITABLE</code>, otherwise returns
<code>ZX_ERR_BAD_HANDLE</code>.</p>
#### Request {#Directory1.Link_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>src</code></td>
<td>
<code>string[255]</code>
</td>
</tr>
<tr>
<td><code>dst_parent_token</code></td>
<td>
<code>handle&lt;handle&gt;</code>
</td>
</tr>
<tr>
<td><code>dst</code></td>
<td>
<code>string[255]</code>
</td>
</tr>
</table>
#### Response {#Directory1.Link_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
### OnOpen {#Directory1.OnOpen}
<p>An event produced eagerly by a FIDL server if requested by <code>OpenFlags.DESCRIBE</code>.</p>
<p>Indicates the success or failure of the open operation, and optionally describes the
object. If the status is <code>ZX_OK</code>, <code>info</code> contains descriptive information about the object
(the same as would be returned by <code>Describe</code>).</p>
#### Response {#Directory1.OnOpen_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>info</code></td>
<td>
<code><a class='link' href='#NodeInfoDeprecated'>NodeInfoDeprecated</a>?</code>
</td>
</tr>
</table>
### Open {#Directory1.Open}
<p>Opens a new object relative to this directory object.</p>
<p><code>path</code> may contain multiple segments, separated by &quot;/&quot; characters, and should never be
empty; i.e. &quot;&quot; is an invalid path. A trailing slash implies OpenFlags.DIRECTORY. Components
must not be empty (i.e. &quot;foo//bar&quot; is invalid). &quot;..&quot; is disallowed anywhere in the path. &quot;.&quot;
is only allowed if the path is exactly &quot;.&quot;, but not otherwise. A leading '/' is allowed (and
is treated the same way as if not present, i.e. &quot;/foo/bar' and &quot;foo/bar&quot; are the same).</p>
<p>If an unknown value is sent for flags the connection should be closed.</p>
<p><code>OpenFlags.RIGHT_*</code> flags provided in <code>flags</code> will restrict access rights on
the <code>object</code> channel which will be connected to the opened entity.</p>
<p>Rights are never increased. When you open a nested entity within a directory, you may only
request the same rights as what the directory connection already has, or a subset of those.
Exceeding those rights causes an access denied error to be transmitted in the
<code>OnOpen</code> event if applicable, and the <code>object</code> connection closed.</p>
<p><code>mode</code> is ignored.</p>
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 12</span></div>
#### Request {#Directory1.Open_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
<tr>
<td><code>mode</code></td>
<td>
<code><a class='link' href='#ModeType'>ModeType</a></code>
</td>
</tr>
<tr>
<td><code>path</code></td>
<td>
<code>string[4095]</code>
</td>
</tr>
<tr>
<td><code>object</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Node'>Node</a>&gt;</code>
</td>
</tr>
</table>
### QueryFilesystem {#Directory1.QueryFilesystem}
<p>Query the filesystem for filesystem-specific information.</p>
#### Request {#Directory1.QueryFilesystem_Request}
&lt;EMPTY&gt;
#### Response {#Directory1.QueryFilesystem_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>info</code></td>
<td>
<code><a class='link' href='#FilesystemInfo'>FilesystemInfo</a>?</code>
</td>
</tr>
</table>
### ReadDirents {#Directory1.ReadDirents}
<p>Reads a collection of variably sized dirents into a buffer.
The number of dirents in a directory may be very large: akin to
calling read multiple times on a file, directories have a seek
offset which is updated on subsequent calls to ReadDirents.
Each call to ReadDirents will only return whole dirent structures,
they will not get split across ReadDirent calls. When the seek
offset reaches the end, <code>dirents</code> will be empty.</p>
<p>These dirents are of the form:</p>
<pre><code>struct dirent {
// Describes the inode of the entry.
uint64 ino;
// Describes the length of the dirent name in bytes.
uint8 size;
// Describes the type of the entry. Aligned with the
// POSIX d_type values. Use `DirentType` constants.
uint8 type;
// Unterminated name of entry.
char name[0];
}
</code></pre>
<p>This method does not require any rights, since one could always probe for
directory contents by triggering name conflicts during file creation.</p>
#### Request {#Directory1.ReadDirents_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>max_bytes</code></td>
<td>
<code>uint64</code>
</td>
</tr>
</table>
#### Response {#Directory1.ReadDirents_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>dirents</code></td>
<td>
<code>vector&lt;uint8&gt;[8192]</code>
</td>
</tr>
</table>
### Rewind {#Directory1.Rewind}
<p>Resets the directory seek offset.</p>
<p>This method does not require any rights, similar to ReadDirents.</p>
#### Request {#Directory1.Rewind_Request}
&lt;EMPTY&gt;
#### Response {#Directory1.Rewind_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
### SetAttr {#Directory1.SetAttr}
<p>Updates information about the node.</p>
<p>This method requires following rights: <code>OpenFlags.RIGHT_WRITABLE</code>, otherwise returns
<code>ZX_ERR_BAD_HANDLE</code>.</p>
#### Request {#Directory1.SetAttr_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#NodeAttributeFlags'>NodeAttributeFlags</a></code>
</td>
</tr>
<tr>
<td><code>attributes</code></td>
<td>
<code><a class='link' href='#NodeAttributes'>NodeAttributes</a></code>
</td>
</tr>
</table>
#### Response {#Directory1.SetAttr_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
### SetFlags {#Directory1.SetFlags}
<p>Changes the <code>Directory.Open</code> flags used to access the file.
Supported flags which can be turned on / off:</p>
<ul>
<li><code>OpenFlags.APPEND</code></li>
</ul>
<p>This method does not require any rights.</p>
#### Request {#Directory1.SetFlags_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
</table>
#### Response {#Directory1.SetFlags_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
### Watch {#Directory1.Watch}
<p>Watches a directory, receiving events of added messages on the
watcher request channel.</p>
<p>Options must be zero; it is reserved.</p>
<p>This method does not require any rights, similar to ReadDirents.</p>
#### Request {#Directory1.Watch_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>mask</code></td>
<td>
<code><a class='link' href='#WatchMask'>WatchMask</a></code>
</td>
</tr>
<tr>
<td><code>options</code></td>
<td>
<code>uint32</code>
</td>
</tr>
<tr>
<td><code>watcher</code></td>
<td>
<code>server_end&lt;<a class='link' href='#DirectoryWatcher'>DirectoryWatcher</a>&gt;</code>
</td>
</tr>
</table>
#### Response {#Directory1.Watch_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
## Directory2 {#Directory2}
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=49)*
<p>A <a class='link' href='#Node2'>Node2</a> that is capable of containing other nodes.</p>
### AddInotifyFilter {#Directory2.AddInotifyFilter}
<p>Adds a new inotify filter for an object relative to this directory object.</p>
<ul>
<li>
<p>'filter` is a mask of different inotify events that need to be watched by the server
for a specific file/directory.</p>
</li>
<li>
<p><code>path</code> may contain multiple segments, separated by &quot;/&quot; characters,
and should never be empty; i.e., &quot;&quot; is an invalid path. Paths should not contain
a leading &quot;/&quot;.</p>
</li>
</ul>
<p>+<code>watch_descriptor</code> is client assigned value to identify a filter.
Server shouldn't trust the client-assigned watch_descriptor. They should just send it
back to the client in the socket.
This value is not used by server, but it is returned back as part of InotifyEvent,
to help the client correlate filter with events on this filter.</p>
<ul>
<li><code>socket</code> is shared between different filter objects i.e every new filter will
have a different server end of the socket and there will be a single client end per
inotify instance on inotify init.</li>
</ul>
#### Request {#Directory2.AddInotifyFilter_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>path</code></td>
<td>
<code><a class='link' href='#Path'>Path</a></code>
</td>
</tr>
<tr>
<td><code>filter</code></td>
<td>
<code><a class='link' href='#InotifyWatchMask'>InotifyWatchMask</a></code>
</td>
</tr>
<tr>
<td><code>watch_descriptor</code></td>
<td>
<code>uint32</code>
</td>
</tr>
<tr>
<td><code>socket</code></td>
<td>
<code>handle&lt;socket&gt;</code>
</td>
</tr>
</table>
#### Response {#Directory2.AddInotifyFilter_Response}
&lt;EMPTY&gt;
### AdvisoryLock {#Directory2.AdvisoryLock}
<p>Acquires an advisory lock on the underlying file.</p>
<p>The lock lasts until either this connection is closed or
this method is called with |AdvisoryLockType.UNLOCK| to release the lock
explicitly.</p>
<p>Advisory locks are purely advisory. They do not prevent actual read or
write operations from occurring on the file, either through this
connection or through other connections.</p>
<p>This method requires the following rights:</p>
<ul>
<li><a class='link' href='#Rights.READ_BYTES'>Rights.READ_BYTES</a> if <code>request.type</code> is <a class='link' href='#AdvisoryLockType.READ'>AdvisoryLockType.READ</a>.</li>
<li><a class='link' href='#Rights.WRITE_BYTES'>Rights.WRITE_BYTES</a> if <code>request.type</code> is
<a class='link' href='#AdvisoryLockType.WRITE'>AdvisoryLockType.WRITE</a>.</li>
</ul>
<h1>Errors</h1>
<ul>
<li><code>ZX_ERR_BAD_STATE</code> The specified type of lock cannot be acquired. For
example, another connection might hold a conflicting lock type.</li>
<li><code>ZX_ERR_NOT_SUPPORTED</code> This file does not support advisory locking.</li>
<li><code>ZX_ERR_ACCESS_DENIED</code> This connection does not have sufficient rights
to acquire the given type of lock.</li>
</ul>
#### Request {#Directory2.AdvisoryLock_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>request</code></td>
<td>
<code><a class='link' href='#AdvisoryLockRequest'>AdvisoryLockRequest</a></code>
</td>
</tr>
</table>
#### Response {#Directory2.AdvisoryLock_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#AdvisoryLocking_AdvisoryLock_Result'>AdvisoryLocking_AdvisoryLock_Result</a></code>
</td>
</tr>
</table>
### Close {#Directory2.Close}
<p>Terminates the connection.</p>
<p>After calling <code>Close</code>, the client must not send any other requests.</p>
<p>Servers, after sending the status response, should close the connection
regardless of status and without sending an epitaph.</p>
<p>Closing the client end of the channel should be semantically equivalent
to calling <code>Close</code> without knowing when the close has completed or its
status.</p>
#### Request {#Directory2.Close_Request}
&lt;EMPTY&gt;
#### Response {#Directory2.Close_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='../fuchsia.unknown/'>fuchsia.unknown</a>/<a class='link' href='../fuchsia.unknown/#Closeable_Close_Result'>Closeable_Close_Result</a></code>
</td>
</tr>
</table>
### Enumerate {#Directory2.Enumerate}
<p>Initiates a directory listing operation over the input channel,
starting at seek offset 0.</p>
<p>This method requires the <a class='link' href='#Rights.ENUMERATE'>Rights.ENUMERATE</a> right. If this right is
absent, <code>iterator</code> will be closed with a <code>ZX_ERR_ACCESS_DENIED</code> epitaph.</p>
#### Request {#Directory2.Enumerate_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>options</code></td>
<td>
<code><a class='link' href='#DirectoryEnumerateOptions'>DirectoryEnumerateOptions</a></code>
</td>
</tr>
<tr>
<td><code>iterator</code></td>
<td>
<code>server_end&lt;<a class='link' href='#DirectoryIterator'>DirectoryIterator</a>&gt;</code>
</td>
</tr>
</table>
### GetAttributes {#Directory2.GetAttributes}
<p>Acquires information about the node.</p>
<p>The attributes of a node should be stable, independent of the
specific protocol used to access it.</p>
<p>If a particular attribute is not applicable or not supported,
filesystems should leave the corresponding field absent.</p>
<ul>
<li><code>query</code> a bit-mask specifying which attributes to fetch. The server
should not return more than necessary.</li>
</ul>
<ul>
<li><code>attributes</code> the returned attributes.</li>
</ul>
<p>This method requires the <a class='link' href='#Rights.GET_ATTRIBUTES'>Rights.GET_ATTRIBUTES</a> right.</p>
#### Request {#Directory2.GetAttributes_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>query</code></td>
<td>
<code><a class='link' href='#NodeAttributesQuery'>NodeAttributesQuery</a></code>
</td>
</tr>
</table>
#### Response {#Directory2.GetAttributes_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Node2_GetAttributes_Result'>Node2_GetAttributes_Result</a></code>
</td>
</tr>
</table>
### GetConnectionInfo {#Directory2.GetConnectionInfo}
<p>Acquires information about the connection.</p>
<p>This method does not require any rights.</p>
#### Request {#Directory2.GetConnectionInfo_Request}
&lt;EMPTY&gt;
#### Response {#Directory2.GetConnectionInfo_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#ConnectionInfo'>ConnectionInfo</a></code>
</td>
</tr>
</table>
### OnRepresentation {#Directory2.OnRepresentation}
<p>An event produced eagerly by the server if requested by
<a class='link' href='#NodeFlags.GET_REPRESENTATION'>NodeFlags.GET_REPRESENTATION</a>. This event will be the first message
from the server, and is sent exactly once.</p>
<p>The active variant corresponds to one of the supported protocols of
the node, and represents the result of the connection-time
negotiation. Provides auxiliary handles if applicable.</p>
<p>If the client specified more than one protocol in <code>protocols</code> during
<a class='link' href='#Directory.Open'>Directory.Open</a>, the <a class='link' href='#Representation'>Representation</a> carries additionally the
result of the connection-time negotiation via its tag.</p>
<p>The elements have one-to-one correspondence with the members of
<a class='link' href='#NodeProtocolKinds'>NodeProtocolKinds</a>.</p>
<p>This is a special case of <a class='link' href='../fuchsia.unknown/'>fuchsia.unknown</a>/<a class='link' href='../fuchsia.unknown/#Queryable.Query'>Queryable.Query</a> +
inherent <code>Describe</code> methods on the specific protocols. It exists as
an optimization to avoid an additional round trip.</p>
#### Response {#Directory2.OnRepresentation_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#Representation'>Representation</a></code>
</td>
</tr>
</table>
### Open2 {#Directory2.Open2}
<p>Opens or creates a new node relative to this directory node.</p>
<p>This method requires the following rights on the current connection:</p>
<ul>
<li><a class='link' href='#Rights.ENUMERATE'>Rights.ENUMERATE</a></li>
<li><a class='link' href='#Rights.TRAVERSE'>Rights.TRAVERSE</a></li>
</ul>
<p>Errors are presented as an epitaph on the <code>object_request</code> channel.</p>
<ul>
<li>error <code>ZX_ERR_ACCESS_DENIED</code> if the requested rights exceeds
what is allowed.</li>
<li>error <code>ZX_ERR_BAD_PATH</code> if <code>path</code> is invalid.</li>
</ul>
#### Request {#Directory2.Open2_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>path</code></td>
<td>
<code><a class='link' href='#Path'>Path</a></code>
</td>
</tr>
<tr>
<td><code>protocols</code></td>
<td>
<code><a class='link' href='#ConnectionProtocols'>ConnectionProtocols</a></code>
</td>
</tr>
<tr>
<td><code>object_request</code></td>
<td>
<code>handle&lt;channel&gt;</code>
</td>
</tr>
</table>
### Query {#Directory2.Query}
#### Request {#Directory2.Query_Request}
&lt;EMPTY&gt;
#### Response {#Directory2.Query_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>protocol</code></td>
<td>
<code>vector&lt;uint8&gt;</code>
</td>
</tr>
</table>
### Rename {#Directory2.Rename}
<p>Renames a node named <code>src</code> to the name <code>dst</code>, in a directory represented
by <code>dst_parent_token</code>.</p>
<p><code>src</code> and <code>dst</code> must be valid node names.
See <a class='link' href='#Name'>Name</a> for what constitutes a valid name.</p>
<p>This method requires the following rights on both the current
connection, and the connection identified by <code>dst_parent_token</code>:</p>
<ul>
<li>
<p><a class='link' href='#Rights.ENUMERATE'>Rights.ENUMERATE</a></p>
</li>
<li>
<p><a class='link' href='#Rights.MODIFY_DIRECTORY'>Rights.MODIFY_DIRECTORY</a></p>
</li>
<li>
<p>error <code>ZX_ERR_INVALID_ARGS</code> if <code>src</code> or <code>dst</code> is invalid.</p>
</li>
</ul>
#### Request {#Directory2.Rename_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>src</code></td>
<td>
<code><a class='link' href='#Name'>Name</a></code>
</td>
</tr>
<tr>
<td><code>dst_parent_token</code></td>
<td>
<code><a class='link' href='#Token'>Token</a></code>
</td>
</tr>
<tr>
<td><code>dst</code></td>
<td>
<code><a class='link' href='#Name'>Name</a></code>
</td>
</tr>
</table>
#### Response {#Directory2.Rename_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Directory2_Rename_Result'>Directory2_Rename_Result</a></code>
</td>
</tr>
</table>
### Reopen {#Directory2.Reopen}
<p>Creates another connection to the same node.</p>
<ul>
<li><code>object_request</code> is the server end of a channel created for the new
connection. The caller may proceed to send messages on the
corresponding client end right away.</li>
</ul>
#### Request {#Directory2.Reopen_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>rights_request</code></td>
<td>
<code><a class='link' href='#RightsRequest'>RightsRequest</a>?</code>
</td>
</tr>
<tr>
<td><code>object_request</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Node'>Node</a>&gt;</code>
</td>
</tr>
</table>
### Sync {#Directory2.Sync}
<p>Synchronizes updates to the node to the underlying media, if it exists.</p>
<p>This method will return when the filesystem server has flushed the
relevant updates to the underlying media, but does not guarantee the
underlying media has persisted the information, nor that any information
is committed to hardware. Clients may use <code>Sync</code> to ensure ordering
between operations.</p>
<p>This method does not require any rights.</p>
#### Request {#Directory2.Sync_Request}
&lt;EMPTY&gt;
#### Response {#Directory2.Sync_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Node2_Sync_Result'>Node2_Sync_Result</a></code>
</td>
</tr>
</table>
### Unlink {#Directory2.Unlink}
<p>Removes a child node from the this directory's list of entries.</p>
<p>Note: this does not guarantee that the underlying object is destroyed.
Although the link will be removed from the containing directory,
objects with multiple references (such as files which are still open)
will not actually be destroyed until all references are closed.</p>
<ul>
<li>error <code>ZX_ERR_ACCESS_DENIED</code> if the connection does not have
<a class='link' href='#Rights.WRITE_BYTES'>Rights.WRITE_BYTES</a>.</li>
<li>error <code>ZX_ERR_NOT_SUPPORTED</code> if the underlying filesystem does not
support writing.</li>
<li>error <code>ZX_ERR_BAD_PATH</code> if <code>name</code> is invalid.</li>
<li>error <code>ZX_ERR_NOT_EMPTY</code> if <code>name</code> refers to a non-empty directory.</li>
<li>error <code>ZX_ERR_UNAVAILABLE</code> if <code>name</code> refers to a mount point,
containing a remote channel.</li>
<li>error <code>ZX_ERR_NOT_DIR</code> if the options requested a directory but
something other than a directory was found.</li>
</ul>
<p>Other errors may be returned for filesystem-specific reasons.</p>
<p>This method requires the following rights:</p>
<ul>
<li><a class='link' href='#Rights.ENUMERATE'>Rights.ENUMERATE</a></li>
<li><a class='link' href='#Rights.MODIFY_DIRECTORY'>Rights.MODIFY_DIRECTORY</a></li>
</ul>
#### Request {#Directory2.Unlink_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>name</code></td>
<td>
<code><a class='link' href='#Name'>Name</a></code>
</td>
</tr>
<tr>
<td><code>options</code></td>
<td>
<code><a class='link' href='#UnlinkOptions'>UnlinkOptions</a></code>
</td>
</tr>
</table>
#### Response {#Directory2.Unlink_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Directory2_Unlink_Result'>Directory2_Unlink_Result</a></code>
</td>
</tr>
</table>
### UpdateAttributes {#Directory2.UpdateAttributes}
<p>Updates information about the node.</p>
<ul>
<li><code>attributes</code> the presence of a table field in <code>attributes</code> indicates
the intent to update the corresponding attribute.</li>
</ul>
<p>This method requires the <a class='link' href='#Rights.UPDATE_ATTRIBUTES'>Rights.UPDATE_ATTRIBUTES</a> right.</p>
#### Request {#Directory2.UpdateAttributes_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#MutableNodeAttributes'>MutableNodeAttributes</a></code>
</td>
</tr>
</table>
#### Response {#Directory2.UpdateAttributes_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Node2_UpdateAttributes_Result'>Node2_UpdateAttributes_Result</a></code>
</td>
</tr>
</table>
## DirectoryIterator {#DirectoryIterator}
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=8)*
### GetNext {#DirectoryIterator.GetNext}
<p>Reads a collection of variably sized directory entries into a buffer.</p>
<p>The number of entries in a directory may be very large: akin to
calling read multiple times on a file, directories have a seek
offset which is updated on subsequent calls to <code>Enumerate</code>.
The caller should always use a receiving buffer size as large as the
maximum channel limit.</p>
<p>When the end of iteration is reached, the returned <code>entries</code> vector
will be empty.</p>
<p>This method does not require any rights, as the rights are checked
in the <a class='link' href='#Directory.Enumerate'>Directory.Enumerate</a> call.</p>
#### Request {#DirectoryIterator.GetNext_Request}
&lt;EMPTY&gt;
#### Response {#DirectoryIterator.GetNext_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#DirectoryIterator_GetNext_Result'>DirectoryIterator_GetNext_Result</a></code>
</td>
</tr>
</table>
## DirectoryWatcher {#DirectoryWatcher}
*Defined in [fuchsia.io/directory.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory.fidl;l=146)*
<p>DirectoryWatcher transmits messages from a filesystem server
about events happening in the filesystem. Clients can register
new watchers using the <code>Directory.Watch</code> method, where they can
filter which events they want to receive notifications for.</p>
<p>The DirectoryWatcher will send messages of the form:</p>
<pre><code>struct {
uint8 event;
uint8 len;
char name[];
};
</code></pre>
<p>Where names are NOT null-terminated. The name is the relative
path to the entry the event is refering to. It will be empty if
the event isn't referencing a particular entry (e.g. for the
<code>IDLE</code> event).</p>
## File {#File}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=54)*
<p>A <a class='link' href='#Node'>Node</a> which contains a sequence of bytes of definite length.</p>
<p>NOTE: cloned connections do not share their seek offset with their source
connection.</p>
### AdvisoryLock {#File.AdvisoryLock}
<p>Acquires an advisory lock on the underlying file.</p>
<p>The lock lasts until either this connection is closed or
this method is called with |AdvisoryLockType.UNLOCK| to release the lock
explicitly.</p>
<p>Advisory locks are purely advisory. They do not prevent actual read or
write operations from occurring on the file, either through this
connection or through other connections.</p>
<p>This method requires the following rights:</p>
<ul>
<li><a class='link' href='#Rights.READ_BYTES'>Rights.READ_BYTES</a> if <code>request.type</code> is <a class='link' href='#AdvisoryLockType.READ'>AdvisoryLockType.READ</a>.</li>
<li><a class='link' href='#Rights.WRITE_BYTES'>Rights.WRITE_BYTES</a> if <code>request.type</code> is
<a class='link' href='#AdvisoryLockType.WRITE'>AdvisoryLockType.WRITE</a>.</li>
</ul>
<h1>Errors</h1>
<ul>
<li><code>ZX_ERR_BAD_STATE</code> The specified type of lock cannot be acquired. For
example, another connection might hold a conflicting lock type.</li>
<li><code>ZX_ERR_NOT_SUPPORTED</code> This file does not support advisory locking.</li>
<li><code>ZX_ERR_ACCESS_DENIED</code> This connection does not have sufficient rights
to acquire the given type of lock.</li>
</ul>
#### Request {#File.AdvisoryLock_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>request</code></td>
<td>
<code><a class='link' href='#AdvisoryLockRequest'>AdvisoryLockRequest</a></code>
</td>
</tr>
</table>
#### Response {#File.AdvisoryLock_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#AdvisoryLocking_AdvisoryLock_Result'>AdvisoryLocking_AdvisoryLock_Result</a></code>
</td>
</tr>
</table>
### Clone {#File.Clone}
<p>Create another connection to the same remote object.</p>
<p><code>flags</code> may be any of:</p>
<ul>
<li><code>OpenFlags.RIGHT_*</code></li>
<li><code>OpenFlags.APPEND</code></li>
<li><code>OpenFlags.DESCRIBE</code></li>
<li><code>OpenFlags.CLONE_SAME_RIGHTS</code></li>
</ul>
<p>All other flags are ignored.</p>
<p>The <code>OpenFlags.RIGHT_*</code> bits in <code>flags</code> request corresponding rights over the resulting
cloned object.
The cloned object must have rights less than or equal to the original object, otherwise
returns <code>ZX_ERR_ACCESS_DENIED</code>.
Alternatively, pass <code>OpenFlags.CLONE_SAME_RIGHTS</code> to inherit the rights on the source connection.
It is invalid to pass any of the <code>OpenFlags.RIGHT_*</code> flags together with
<code>OpenFlags.CLONE_SAME_RIGHTS</code>.</p>
#### Request {#File.Clone_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
<tr>
<td><code>object</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Node'>Node</a>&gt;</code>
</td>
</tr>
</table>
### Close {#File.Close}
<p>Terminates the connection.</p>
<p>After calling <code>Close</code>, the client must not send any other requests.</p>
<p>Servers, after sending the status response, should close the connection
regardless of status and without sending an epitaph.</p>
<p>Closing the client end of the channel should be semantically equivalent
to calling <code>Close</code> without knowing when the close has completed or its
status.</p>
#### Request {#File.Close_Request}
&lt;EMPTY&gt;
#### Response {#File.Close_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='../fuchsia.unknown/'>fuchsia.unknown</a>/<a class='link' href='../fuchsia.unknown/#Closeable_Close_Result'>Closeable_Close_Result</a></code>
</td>
</tr>
</table>
### Describe {#File.Describe}
#### Request {#File.Describe_Request}
&lt;EMPTY&gt;
#### Response {#File.Describe_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#FileInfo'>FileInfo</a></code>
</td>
</tr>
</table>
### GetAttr {#File.GetAttr}
<p>Acquires information about the node.</p>
<p>This method does not require any rights.</p>
#### Request {#File.GetAttr_Request}
&lt;EMPTY&gt;
#### Response {#File.GetAttr_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>attributes</code></td>
<td>
<code><a class='link' href='#NodeAttributes'>NodeAttributes</a></code>
</td>
</tr>
</table>
### GetAttributes {#File.GetAttributes}
<p>Acquires information about the node.</p>
<p>The attributes of a node should be stable, independent of the
specific protocol used to access it.</p>
<p>If a particular attribute is not applicable or not supported,
filesystems should leave the corresponding field absent.</p>
<ul>
<li><code>query</code> a bit-mask specifying which attributes to fetch. The server
should not return more than necessary.</li>
</ul>
<ul>
<li><code>attributes</code> the returned attributes.</li>
</ul>
<p>This method requires the <a class='link' href='#Rights.GET_ATTRIBUTES'>Rights.GET_ATTRIBUTES</a> right.</p>
#### Request {#File.GetAttributes_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>query</code></td>
<td>
<code><a class='link' href='#NodeAttributesQuery'>NodeAttributesQuery</a></code>
</td>
</tr>
</table>
#### Response {#File.GetAttributes_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Node2_GetAttributes_Result'>Node2_GetAttributes_Result</a></code>
</td>
</tr>
</table>
### GetBackingMemory {#File.GetBackingMemory}
<p>Acquires a <a class='link' href='#zx.handle:VMO'>zx.handle:VMO</a> representing this file, if there is one,
with the requested access rights.</p>
<p>Implementations are not required to implement files backed by VMOs so
this request may fail. Additionally, implementations may only support
a certain subset of the flags. Clients should be prepared with fallback
behavior if this request fails.</p>
<p>If a client specifies neither <code>PRIVATE_CLONE</code> nor <code>SHARED_BUFFER</code>, the
implementation is free to choose the semantics of the returned VMO.</p>
<ul>
<li>request <code>flags</code> a <a class='link' href='#VmoFlags'>VmoFlags</a> indicating the desired mode of access.</li>
</ul>
<ul>
<li>response <code>vmo</code> the requested <a class='link' href='#zx.handle:VMO'>zx.handle:VMO</a>.</li>
</ul>
<ul>
<li>error a <a class='link' href='#zx.status'>zx.status</a> value indicating the failure.</li>
</ul>
<p>This method requires the following rights:</p>
<ul>
<li><a class='link' href='#Rights.READ_BYTES'>Rights.READ_BYTES</a> if <code>flags</code> includes <a class='link' href='#VmoFlags.READ'>VmoFlags.READ</a>.</li>
<li><a class='link' href='#Rights.WRITE_BYTES'>Rights.WRITE_BYTES</a> if <code>flags</code> includes <a class='link' href='#VmoFlags.WRITE'>VmoFlags.WRITE</a>.</li>
<li><a class='link' href='#Rights.EXECUTE'>Rights.EXECUTE</a> if <code>flags</code> includes <a class='link' href='#VmoFlags.EXECUTE'>VmoFlags.EXECUTE</a>.</li>
</ul>
#### Request {#File.GetBackingMemory_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#VmoFlags'>VmoFlags</a></code>
</td>
</tr>
</table>
#### Response {#File.GetBackingMemory_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#File_GetBackingMemory_Result'>File_GetBackingMemory_Result</a></code>
</td>
</tr>
</table>
### GetConnectionInfo {#File.GetConnectionInfo}
<p>Acquires information about the connection.</p>
<p>This method does not require any rights.</p>
#### Request {#File.GetConnectionInfo_Request}
&lt;EMPTY&gt;
#### Response {#File.GetConnectionInfo_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#ConnectionInfo'>ConnectionInfo</a></code>
</td>
</tr>
</table>
### GetFlags {#File.GetFlags}
<p>Acquires the <code>Directory.Open</code> rights and flags used to access this file.</p>
<p>This method does not require any rights.</p>
#### Request {#File.GetFlags_Request}
&lt;EMPTY&gt;
#### Response {#File.GetFlags_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
</table>
### OnOpen {#File.OnOpen}
<p>An event produced eagerly by a FIDL server if requested by <code>OpenFlags.DESCRIBE</code>.</p>
<p>Indicates the success or failure of the open operation, and optionally describes the
object. If the status is <code>ZX_OK</code>, <code>info</code> contains descriptive information about the object
(the same as would be returned by <code>Describe</code>).</p>
#### Response {#File.OnOpen_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>info</code></td>
<td>
<code><a class='link' href='#NodeInfoDeprecated'>NodeInfoDeprecated</a>?</code>
</td>
</tr>
</table>
### OnRepresentation {#File.OnRepresentation}
<p>An event produced eagerly by the server if requested by
<a class='link' href='#NodeFlags.GET_REPRESENTATION'>NodeFlags.GET_REPRESENTATION</a>. This event will be the first message
from the server, and is sent exactly once.</p>
<p>The active variant corresponds to one of the supported protocols of
the node, and represents the result of the connection-time
negotiation. Provides auxiliary handles if applicable.</p>
<p>If the client specified more than one protocol in <code>protocols</code> during
<a class='link' href='#Directory.Open'>Directory.Open</a>, the <a class='link' href='#Representation'>Representation</a> carries additionally the
result of the connection-time negotiation via its tag.</p>
<p>The elements have one-to-one correspondence with the members of
<a class='link' href='#NodeProtocolKinds'>NodeProtocolKinds</a>.</p>
<p>This is a special case of <a class='link' href='../fuchsia.unknown/'>fuchsia.unknown</a>/<a class='link' href='../fuchsia.unknown/#Queryable.Query'>Queryable.Query</a> +
inherent <code>Describe</code> methods on the specific protocols. It exists as
an optimization to avoid an additional round trip.</p>
#### Response {#File.OnRepresentation_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#Representation'>Representation</a></code>
</td>
</tr>
</table>
### Query {#File.Query}
#### Request {#File.Query_Request}
&lt;EMPTY&gt;
#### Response {#File.Query_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>protocol</code></td>
<td>
<code>vector&lt;uint8&gt;</code>
</td>
</tr>
</table>
### QueryFilesystem {#File.QueryFilesystem}
<p>Query the filesystem for filesystem-specific information.</p>
#### Request {#File.QueryFilesystem_Request}
&lt;EMPTY&gt;
#### Response {#File.QueryFilesystem_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>info</code></td>
<td>
<code><a class='link' href='#FilesystemInfo'>FilesystemInfo</a>?</code>
</td>
</tr>
</table>
### Read {#File.Read}
<p>Reads up to 'count' bytes at the seek offset.
The seek offset is moved forward by the number of bytes read.</p>
<h2>Invariants</h2>
<ul>
<li>The returned <code>data.length</code> will never be greater than <code>count</code>.</li>
<li>If <code>data.length</code> is less than <code>count</code>, it means that the seek offset
has reached the end of file as part of this operation.</li>
<li>If <code>data.length</code> is zero while <code>count</code> is not, it means that the
seek offset is already at or beyond the end of file, and no data could
be read.</li>
<li>If <code>count</code> is zero, the server should perform all the checks ensuring
read access without actually read anything, and return an empty
<code>data</code> vector.</li>
</ul>
<p>This method requires the <a class='link' href='#Rights.READ_BYTES'>Rights.READ_BYTES</a> right.</p>
<p>Returns <code>ZX_ERR_OUT_OF_RANGE</code> if <code>count</code> is greater than <code>MAX_TRANSFER_SIZE</code>.</p>
#### Request {#File.Read_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>count</code></td>
<td>
<code>uint64</code>
</td>
</tr>
</table>
#### Response {#File.Read_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Readable_Read_Result'>Readable_Read_Result</a></code>
</td>
</tr>
</table>
### ReadAt {#File.ReadAt}
<p>Reads up to 'count' bytes at the provided offset.
Does not affect the seek offset.</p>
<h2>Invariants</h2>
<ul>
<li>The returned <code>data.length</code> will never be greater than <code>count</code>.</li>
<li>If <code>data.length</code> is less than <code>count</code>, it means that <code>ReadAt</code> has hit
the end of file as part of this operation.</li>
<li>If <code>data.length</code> is zero while <code>count</code> is not, it means that <code>offset</code>
is at or past the end of file, and no data can be read.</li>
<li>If <code>count</code> is zero, the server should perform all the checks ensuring
read access without actually reading anything, and return an empty
<code>data</code> vector.</li>
</ul>
<p>This method requires the <a class='link' href='#Rights.READ_BYTES'>Rights.READ_BYTES</a> right.</p>
<p>Returns <code>ZX_ERR_OUT_OF_RANGE</code> if <code>count</code> is greater than <code>MAX_TRANSFER_SIZE</code>.</p>
#### Request {#File.ReadAt_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>count</code></td>
<td>
<code>uint64</code>
</td>
</tr>
<tr>
<td><code>offset</code></td>
<td>
<code>uint64</code>
</td>
</tr>
</table>
#### Response {#File.ReadAt_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#File_ReadAt_Result'>File_ReadAt_Result</a></code>
</td>
</tr>
</table>
### Reopen {#File.Reopen}
<p>Creates another connection to the same node.</p>
<ul>
<li><code>object_request</code> is the server end of a channel created for the new
connection. The caller may proceed to send messages on the
corresponding client end right away.</li>
</ul>
#### Request {#File.Reopen_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>rights_request</code></td>
<td>
<code><a class='link' href='#RightsRequest'>RightsRequest</a>?</code>
</td>
</tr>
<tr>
<td><code>object_request</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Node'>Node</a>&gt;</code>
</td>
</tr>
</table>
### Resize {#File.Resize}
<p>Shrinks or grows the file size to 'length' bytes.</p>
<p>If file size is reduced by this operation, the extra trailing data'
is discarded.
If file size is increased by this operation, the extended area appears
as if it was zeroed.</p>
<p>This method requires the <a class='link' href='#Rights.WRITE_BYTES'>Rights.WRITE_BYTES</a> right.</p>
#### Request {#File.Resize_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>length</code></td>
<td>
<code>uint64</code>
</td>
</tr>
</table>
#### Response {#File.Resize_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#File_Resize_Result'>File_Resize_Result</a></code>
</td>
</tr>
</table>
### Seek {#File.Seek}
<p>Moves the offset at which the next invocation of <a class='link' href='#Read'>Read</a> or <a class='link' href='#Write'>Write</a>
will occur. The seek offset is specific to each file connection.</p>
<ul>
<li>request <code>origin</code> the reference point where <code>offset</code> will be based on.</li>
<li>request <code>offset</code> the number of bytes to seek.</li>
</ul>
<ul>
<li>response <code>offset_from_start</code> the adjusted seek offset, from the start
of the file.</li>
</ul>
<p>This method does not require any rights.</p>
#### Request {#File.Seek_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>origin</code></td>
<td>
<code><a class='link' href='#SeekOrigin'>SeekOrigin</a></code>
</td>
</tr>
<tr>
<td><code>offset</code></td>
<td>
<code>int64</code>
</td>
</tr>
</table>
#### Response {#File.Seek_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#File_Seek_Result'>File_Seek_Result</a></code>
</td>
</tr>
</table>
### SetAttr {#File.SetAttr}
<p>Updates information about the node.</p>
<p>This method requires following rights: <code>OpenFlags.RIGHT_WRITABLE</code>, otherwise returns
<code>ZX_ERR_BAD_HANDLE</code>.</p>
#### Request {#File.SetAttr_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#NodeAttributeFlags'>NodeAttributeFlags</a></code>
</td>
</tr>
<tr>
<td><code>attributes</code></td>
<td>
<code><a class='link' href='#NodeAttributes'>NodeAttributes</a></code>
</td>
</tr>
</table>
#### Response {#File.SetAttr_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
### SetFlags {#File.SetFlags}
<p>Changes the <code>Directory.Open</code> flags used to access the file.
Supported flags which can be turned on / off:</p>
<ul>
<li><code>OpenFlags.APPEND</code></li>
</ul>
<p>This method does not require any rights.</p>
#### Request {#File.SetFlags_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
</table>
#### Response {#File.SetFlags_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
### Sync {#File.Sync}
<p>Synchronizes updates to the node to the underlying media, if it exists.</p>
<p>This method will return when the filesystem server has flushed the
relevant updates to the underlying media, but does not guarantee the
underlying media has persisted the information, nor that any information
is committed to hardware. Clients may use <code>Sync</code> to ensure ordering
between operations.</p>
<p>This method does not require any rights.</p>
#### Request {#File.Sync_Request}
&lt;EMPTY&gt;
#### Response {#File.Sync_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Node2_Sync_Result'>Node2_Sync_Result</a></code>
</td>
</tr>
</table>
### UpdateAttributes {#File.UpdateAttributes}
<p>Updates information about the node.</p>
<ul>
<li><code>attributes</code> the presence of a table field in <code>attributes</code> indicates
the intent to update the corresponding attribute.</li>
</ul>
<p>This method requires the <a class='link' href='#Rights.UPDATE_ATTRIBUTES'>Rights.UPDATE_ATTRIBUTES</a> right.</p>
#### Request {#File.UpdateAttributes_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#MutableNodeAttributes'>MutableNodeAttributes</a></code>
</td>
</tr>
</table>
#### Response {#File.UpdateAttributes_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Node2_UpdateAttributes_Result'>Node2_UpdateAttributes_Result</a></code>
</td>
</tr>
</table>
### Write {#File.Write}
<p>Writes data at the seek offset.
The seek offset is moved forward by the number of bytes written.
If the file is in append mode, the seek offset is first set to the end
of the file, followed by the write, in one atomic step.</p>
<p>The file size may grow if the seek offset plus <code>data.length</code> is beyond
the current end of file.</p>
<ul>
<li>request <code>data</code> the byte buffer to write to the file.</li>
</ul>
<ul>
<li>response <code>actual_count</code> the number of bytes written.</li>
</ul>
<h2>Invariants</h2>
<ul>
<li>The returned <code>actual_count</code> will never be greater than <code>data.length</code>.</li>
<li>If the server is unable to write all the data due to e.g. not enough
space, <code>actual_count</code> may be less than <code>data.length</code>. If no bytes
could be written, an error is returned.</li>
<li>If <code>data.length</code> is zero, the server should perform all the checks
ensuring write access without mutating the file and return a
successful write of zero bytes. The seek offset is still updated if
in append mode.</li>
</ul>
<p>This method requires the <a class='link' href='#Rights.WRITE_BYTES'>Rights.WRITE_BYTES</a> right.</p>
#### Request {#File.Write_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>data</code></td>
<td>
<code><a class='link' href='#Transfer'>Transfer</a></code>
</td>
</tr>
</table>
#### Response {#File.Write_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Writable_Write_Result'>Writable_Write_Result</a></code>
</td>
</tr>
</table>
### WriteAt {#File.WriteAt}
<p>Writes data at the provided offset.
Does not affect the seek offset.</p>
<p>The file size may grow if <code>offset</code> plus <code>data.length</code> is past the
current end of file.</p>
<ul>
<li>request <code>data</code> the byte buffer to write to the file.</li>
<li>request <code>offset</code> the offset from start of the file to begin writing.</li>
</ul>
<ul>
<li>response <code>actual_count</code> the number of bytes written.</li>
</ul>
<h2>Invariants</h2>
<ul>
<li>The returned <code>actual_count</code> will never be greater than <code>data.length</code>.</li>
<li>If the server is unable to write all the data due to e.g. not enough
space, <code>actual_count</code> may be less than <code>data.length</code>. If no bytes
could be written, an error is returned.</li>
<li>If <code>data.length</code> is zero, the server should perform all the checks
ensuring write access without mutating the file, and will return a
successful write of zero bytes.</li>
</ul>
<p>This method requires the <a class='link' href='#Rights.WRITE_BYTES'>Rights.WRITE_BYTES</a> right.</p>
#### Request {#File.WriteAt_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>data</code></td>
<td>
<code><a class='link' href='#Transfer'>Transfer</a></code>
</td>
</tr>
<tr>
<td><code>offset</code></td>
<td>
<code>uint64</code>
</td>
</tr>
</table>
#### Response {#File.WriteAt_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#File_WriteAt_Result'>File_WriteAt_Result</a></code>
</td>
</tr>
</table>
## Inotifier {#Inotifier}
*Defined in [fuchsia.io/inotify.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/inotify.fidl;l=12)*
<p>Inotifier implements the linux Inotify functionality.
It provides a mechanism for monitoring filesystem
events. Inotify can be used to monitor individual files, or to
monitor directories. When a directory is monitored, inotify will
return events for the directory itself, and for files inside the
directory.</p>
## Node {#Node}
*Defined in [fuchsia.io/node.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node.fidl;l=56)*
### Clone {#Node.Clone}
<p>Create another connection to the same remote object.</p>
<p><code>flags</code> may be any of:</p>
<ul>
<li><code>OpenFlags.RIGHT_*</code></li>
<li><code>OpenFlags.APPEND</code></li>
<li><code>OpenFlags.DESCRIBE</code></li>
<li><code>OpenFlags.CLONE_SAME_RIGHTS</code></li>
</ul>
<p>All other flags are ignored.</p>
<p>The <code>OpenFlags.RIGHT_*</code> bits in <code>flags</code> request corresponding rights over the resulting
cloned object.
The cloned object must have rights less than or equal to the original object, otherwise
returns <code>ZX_ERR_ACCESS_DENIED</code>.
Alternatively, pass <code>OpenFlags.CLONE_SAME_RIGHTS</code> to inherit the rights on the source connection.
It is invalid to pass any of the <code>OpenFlags.RIGHT_*</code> flags together with
<code>OpenFlags.CLONE_SAME_RIGHTS</code>.</p>
#### Request {#Node.Clone_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
<tr>
<td><code>object</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Node'>Node</a>&gt;</code>
</td>
</tr>
</table>
### Close {#Node.Close}
<p>Terminates the connection.</p>
<p>After calling <code>Close</code>, the client must not send any other requests.</p>
<p>Servers, after sending the status response, should close the connection
regardless of status and without sending an epitaph.</p>
<p>Closing the client end of the channel should be semantically equivalent
to calling <code>Close</code> without knowing when the close has completed or its
status.</p>
#### Request {#Node.Close_Request}
&lt;EMPTY&gt;
#### Response {#Node.Close_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='../fuchsia.unknown/'>fuchsia.unknown</a>/<a class='link' href='../fuchsia.unknown/#Closeable_Close_Result'>Closeable_Close_Result</a></code>
</td>
</tr>
</table>
### GetAttr {#Node.GetAttr}
<p>Acquires information about the node.</p>
<p>This method does not require any rights.</p>
#### Request {#Node.GetAttr_Request}
&lt;EMPTY&gt;
#### Response {#Node.GetAttr_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>attributes</code></td>
<td>
<code><a class='link' href='#NodeAttributes'>NodeAttributes</a></code>
</td>
</tr>
</table>
### GetAttributes {#Node.GetAttributes}
<p>Acquires information about the node.</p>
<p>The attributes of a node should be stable, independent of the
specific protocol used to access it.</p>
<p>If a particular attribute is not applicable or not supported,
filesystems should leave the corresponding field absent.</p>
<ul>
<li><code>query</code> a bit-mask specifying which attributes to fetch. The server
should not return more than necessary.</li>
</ul>
<ul>
<li><code>attributes</code> the returned attributes.</li>
</ul>
<p>This method requires the <a class='link' href='#Rights.GET_ATTRIBUTES'>Rights.GET_ATTRIBUTES</a> right.</p>
#### Request {#Node.GetAttributes_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>query</code></td>
<td>
<code><a class='link' href='#NodeAttributesQuery'>NodeAttributesQuery</a></code>
</td>
</tr>
</table>
#### Response {#Node.GetAttributes_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Node2_GetAttributes_Result'>Node2_GetAttributes_Result</a></code>
</td>
</tr>
</table>
### GetConnectionInfo {#Node.GetConnectionInfo}
<p>Acquires information about the connection.</p>
<p>This method does not require any rights.</p>
#### Request {#Node.GetConnectionInfo_Request}
&lt;EMPTY&gt;
#### Response {#Node.GetConnectionInfo_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#ConnectionInfo'>ConnectionInfo</a></code>
</td>
</tr>
</table>
### GetFlags {#Node.GetFlags}
<p>Acquires the <code>Directory.Open</code> rights and flags used to access this file.</p>
<p>This method does not require any rights.</p>
#### Request {#Node.GetFlags_Request}
&lt;EMPTY&gt;
#### Response {#Node.GetFlags_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
</table>
### OnOpen {#Node.OnOpen}
<p>An event produced eagerly by a FIDL server if requested by <code>OpenFlags.DESCRIBE</code>.</p>
<p>Indicates the success or failure of the open operation, and optionally describes the
object. If the status is <code>ZX_OK</code>, <code>info</code> contains descriptive information about the object
(the same as would be returned by <code>Describe</code>).</p>
#### Response {#Node.OnOpen_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>info</code></td>
<td>
<code><a class='link' href='#NodeInfoDeprecated'>NodeInfoDeprecated</a>?</code>
</td>
</tr>
</table>
### OnRepresentation {#Node.OnRepresentation}
<p>An event produced eagerly by the server if requested by
<a class='link' href='#NodeFlags.GET_REPRESENTATION'>NodeFlags.GET_REPRESENTATION</a>. This event will be the first message
from the server, and is sent exactly once.</p>
<p>The active variant corresponds to one of the supported protocols of
the node, and represents the result of the connection-time
negotiation. Provides auxiliary handles if applicable.</p>
<p>If the client specified more than one protocol in <code>protocols</code> during
<a class='link' href='#Directory.Open'>Directory.Open</a>, the <a class='link' href='#Representation'>Representation</a> carries additionally the
result of the connection-time negotiation via its tag.</p>
<p>The elements have one-to-one correspondence with the members of
<a class='link' href='#NodeProtocolKinds'>NodeProtocolKinds</a>.</p>
<p>This is a special case of <a class='link' href='../fuchsia.unknown/'>fuchsia.unknown</a>/<a class='link' href='../fuchsia.unknown/#Queryable.Query'>Queryable.Query</a> +
inherent <code>Describe</code> methods on the specific protocols. It exists as
an optimization to avoid an additional round trip.</p>
#### Response {#Node.OnRepresentation_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#Representation'>Representation</a></code>
</td>
</tr>
</table>
### Query {#Node.Query}
#### Request {#Node.Query_Request}
&lt;EMPTY&gt;
#### Response {#Node.Query_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>protocol</code></td>
<td>
<code>vector&lt;uint8&gt;</code>
</td>
</tr>
</table>
### QueryFilesystem {#Node.QueryFilesystem}
<p>Query the filesystem for filesystem-specific information.</p>
#### Request {#Node.QueryFilesystem_Request}
&lt;EMPTY&gt;
#### Response {#Node.QueryFilesystem_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>info</code></td>
<td>
<code><a class='link' href='#FilesystemInfo'>FilesystemInfo</a>?</code>
</td>
</tr>
</table>
### Reopen {#Node.Reopen}
<p>Creates another connection to the same node.</p>
<ul>
<li><code>object_request</code> is the server end of a channel created for the new
connection. The caller may proceed to send messages on the
corresponding client end right away.</li>
</ul>
#### Request {#Node.Reopen_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>rights_request</code></td>
<td>
<code><a class='link' href='#RightsRequest'>RightsRequest</a>?</code>
</td>
</tr>
<tr>
<td><code>object_request</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Node'>Node</a>&gt;</code>
</td>
</tr>
</table>
### SetAttr {#Node.SetAttr}
<p>Updates information about the node.</p>
<p>This method requires following rights: <code>OpenFlags.RIGHT_WRITABLE</code>, otherwise returns
<code>ZX_ERR_BAD_HANDLE</code>.</p>
#### Request {#Node.SetAttr_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#NodeAttributeFlags'>NodeAttributeFlags</a></code>
</td>
</tr>
<tr>
<td><code>attributes</code></td>
<td>
<code><a class='link' href='#NodeAttributes'>NodeAttributes</a></code>
</td>
</tr>
</table>
#### Response {#Node.SetAttr_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
### SetFlags {#Node.SetFlags}
<p>Changes the <code>Directory.Open</code> flags used to access the file.
Supported flags which can be turned on / off:</p>
<ul>
<li><code>OpenFlags.APPEND</code></li>
</ul>
<p>This method does not require any rights.</p>
#### Request {#Node.SetFlags_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
</table>
#### Response {#Node.SetFlags_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
### Sync {#Node.Sync}
<p>Synchronizes updates to the node to the underlying media, if it exists.</p>
<p>This method will return when the filesystem server has flushed the
relevant updates to the underlying media, but does not guarantee the
underlying media has persisted the information, nor that any information
is committed to hardware. Clients may use <code>Sync</code> to ensure ordering
between operations.</p>
<p>This method does not require any rights.</p>
#### Request {#Node.Sync_Request}
&lt;EMPTY&gt;
#### Response {#Node.Sync_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Node2_Sync_Result'>Node2_Sync_Result</a></code>
</td>
</tr>
</table>
### UpdateAttributes {#Node.UpdateAttributes}
<p>Updates information about the node.</p>
<ul>
<li><code>attributes</code> the presence of a table field in <code>attributes</code> indicates
the intent to update the corresponding attribute.</li>
</ul>
<p>This method requires the <a class='link' href='#Rights.UPDATE_ATTRIBUTES'>Rights.UPDATE_ATTRIBUTES</a> right.</p>
#### Request {#Node.UpdateAttributes_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#MutableNodeAttributes'>MutableNodeAttributes</a></code>
</td>
</tr>
</table>
#### Response {#Node.UpdateAttributes_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Node2_UpdateAttributes_Result'>Node2_UpdateAttributes_Result</a></code>
</td>
</tr>
</table>
## Node1 {#Node1}
*Defined in [fuchsia.io/node.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node.fidl;l=62)*
<p>Node defines the minimal interface for entities which can be accessed in a filesystem.</p>
### Clone {#Node1.Clone}
<p>Create another connection to the same remote object.</p>
<p><code>flags</code> may be any of:</p>
<ul>
<li><code>OpenFlags.RIGHT_*</code></li>
<li><code>OpenFlags.APPEND</code></li>
<li><code>OpenFlags.DESCRIBE</code></li>
<li><code>OpenFlags.CLONE_SAME_RIGHTS</code></li>
</ul>
<p>All other flags are ignored.</p>
<p>The <code>OpenFlags.RIGHT_*</code> bits in <code>flags</code> request corresponding rights over the resulting
cloned object.
The cloned object must have rights less than or equal to the original object, otherwise
returns <code>ZX_ERR_ACCESS_DENIED</code>.
Alternatively, pass <code>OpenFlags.CLONE_SAME_RIGHTS</code> to inherit the rights on the source connection.
It is invalid to pass any of the <code>OpenFlags.RIGHT_*</code> flags together with
<code>OpenFlags.CLONE_SAME_RIGHTS</code>.</p>
#### Request {#Node1.Clone_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
<tr>
<td><code>object</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Node'>Node</a>&gt;</code>
</td>
</tr>
</table>
### GetAttr {#Node1.GetAttr}
<p>Acquires information about the node.</p>
<p>This method does not require any rights.</p>
#### Request {#Node1.GetAttr_Request}
&lt;EMPTY&gt;
#### Response {#Node1.GetAttr_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>attributes</code></td>
<td>
<code><a class='link' href='#NodeAttributes'>NodeAttributes</a></code>
</td>
</tr>
</table>
### GetFlags {#Node1.GetFlags}
<p>Acquires the <code>Directory.Open</code> rights and flags used to access this file.</p>
<p>This method does not require any rights.</p>
#### Request {#Node1.GetFlags_Request}
&lt;EMPTY&gt;
#### Response {#Node1.GetFlags_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
</table>
### OnOpen {#Node1.OnOpen}
<p>An event produced eagerly by a FIDL server if requested by <code>OpenFlags.DESCRIBE</code>.</p>
<p>Indicates the success or failure of the open operation, and optionally describes the
object. If the status is <code>ZX_OK</code>, <code>info</code> contains descriptive information about the object
(the same as would be returned by <code>Describe</code>).</p>
#### Response {#Node1.OnOpen_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>info</code></td>
<td>
<code><a class='link' href='#NodeInfoDeprecated'>NodeInfoDeprecated</a>?</code>
</td>
</tr>
</table>
### QueryFilesystem {#Node1.QueryFilesystem}
<p>Query the filesystem for filesystem-specific information.</p>
#### Request {#Node1.QueryFilesystem_Request}
&lt;EMPTY&gt;
#### Response {#Node1.QueryFilesystem_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
<tr>
<td><code>info</code></td>
<td>
<code><a class='link' href='#FilesystemInfo'>FilesystemInfo</a>?</code>
</td>
</tr>
</table>
### SetAttr {#Node1.SetAttr}
<p>Updates information about the node.</p>
<p>This method requires following rights: <code>OpenFlags.RIGHT_WRITABLE</code>, otherwise returns
<code>ZX_ERR_BAD_HANDLE</code>.</p>
#### Request {#Node1.SetAttr_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#NodeAttributeFlags'>NodeAttributeFlags</a></code>
</td>
</tr>
<tr>
<td><code>attributes</code></td>
<td>
<code><a class='link' href='#NodeAttributes'>NodeAttributes</a></code>
</td>
</tr>
</table>
#### Response {#Node1.SetAttr_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
### SetFlags {#Node1.SetFlags}
<p>Changes the <code>Directory.Open</code> flags used to access the file.
Supported flags which can be turned on / off:</p>
<ul>
<li><code>OpenFlags.APPEND</code></li>
</ul>
<p>This method does not require any rights.</p>
#### Request {#Node1.SetFlags_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
</table>
#### Response {#Node1.SetFlags_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>s</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
</tr>
</table>
## Node2 {#Node2}
*Defined in [fuchsia.io/node2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node2.fidl;l=33)*
<p>Node defines the minimal protocol for entities which can be accessed
in a filesystem.</p>
### Close {#Node2.Close}
<p>Terminates the connection.</p>
<p>After calling <code>Close</code>, the client must not send any other requests.</p>
<p>Servers, after sending the status response, should close the connection
regardless of status and without sending an epitaph.</p>
<p>Closing the client end of the channel should be semantically equivalent
to calling <code>Close</code> without knowing when the close has completed or its
status.</p>
#### Request {#Node2.Close_Request}
&lt;EMPTY&gt;
#### Response {#Node2.Close_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='../fuchsia.unknown/'>fuchsia.unknown</a>/<a class='link' href='../fuchsia.unknown/#Closeable_Close_Result'>Closeable_Close_Result</a></code>
</td>
</tr>
</table>
### GetAttributes {#Node2.GetAttributes}
<p>Acquires information about the node.</p>
<p>The attributes of a node should be stable, independent of the
specific protocol used to access it.</p>
<p>If a particular attribute is not applicable or not supported,
filesystems should leave the corresponding field absent.</p>
<ul>
<li><code>query</code> a bit-mask specifying which attributes to fetch. The server
should not return more than necessary.</li>
</ul>
<ul>
<li><code>attributes</code> the returned attributes.</li>
</ul>
<p>This method requires the <a class='link' href='#Rights.GET_ATTRIBUTES'>Rights.GET_ATTRIBUTES</a> right.</p>
#### Request {#Node2.GetAttributes_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>query</code></td>
<td>
<code><a class='link' href='#NodeAttributesQuery'>NodeAttributesQuery</a></code>
</td>
</tr>
</table>
#### Response {#Node2.GetAttributes_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Node2_GetAttributes_Result'>Node2_GetAttributes_Result</a></code>
</td>
</tr>
</table>
### GetConnectionInfo {#Node2.GetConnectionInfo}
<p>Acquires information about the connection.</p>
<p>This method does not require any rights.</p>
#### Request {#Node2.GetConnectionInfo_Request}
&lt;EMPTY&gt;
#### Response {#Node2.GetConnectionInfo_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#ConnectionInfo'>ConnectionInfo</a></code>
</td>
</tr>
</table>
### OnRepresentation {#Node2.OnRepresentation}
<p>An event produced eagerly by the server if requested by
<a class='link' href='#NodeFlags.GET_REPRESENTATION'>NodeFlags.GET_REPRESENTATION</a>. This event will be the first message
from the server, and is sent exactly once.</p>
<p>The active variant corresponds to one of the supported protocols of
the node, and represents the result of the connection-time
negotiation. Provides auxiliary handles if applicable.</p>
<p>If the client specified more than one protocol in <code>protocols</code> during
<a class='link' href='#Directory.Open'>Directory.Open</a>, the <a class='link' href='#Representation'>Representation</a> carries additionally the
result of the connection-time negotiation via its tag.</p>
<p>The elements have one-to-one correspondence with the members of
<a class='link' href='#NodeProtocolKinds'>NodeProtocolKinds</a>.</p>
<p>This is a special case of <a class='link' href='../fuchsia.unknown/'>fuchsia.unknown</a>/<a class='link' href='../fuchsia.unknown/#Queryable.Query'>Queryable.Query</a> +
inherent <code>Describe</code> methods on the specific protocols. It exists as
an optimization to avoid an additional round trip.</p>
#### Response {#Node2.OnRepresentation_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#Representation'>Representation</a></code>
</td>
</tr>
</table>
### Query {#Node2.Query}
#### Request {#Node2.Query_Request}
&lt;EMPTY&gt;
#### Response {#Node2.Query_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>protocol</code></td>
<td>
<code>vector&lt;uint8&gt;</code>
</td>
</tr>
</table>
### Reopen {#Node2.Reopen}
<p>Creates another connection to the same node.</p>
<ul>
<li><code>object_request</code> is the server end of a channel created for the new
connection. The caller may proceed to send messages on the
corresponding client end right away.</li>
</ul>
#### Request {#Node2.Reopen_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>rights_request</code></td>
<td>
<code><a class='link' href='#RightsRequest'>RightsRequest</a>?</code>
</td>
</tr>
<tr>
<td><code>object_request</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Node'>Node</a>&gt;</code>
</td>
</tr>
</table>
### Sync {#Node2.Sync}
<p>Synchronizes updates to the node to the underlying media, if it exists.</p>
<p>This method will return when the filesystem server has flushed the
relevant updates to the underlying media, but does not guarantee the
underlying media has persisted the information, nor that any information
is committed to hardware. Clients may use <code>Sync</code> to ensure ordering
between operations.</p>
<p>This method does not require any rights.</p>
#### Request {#Node2.Sync_Request}
&lt;EMPTY&gt;
#### Response {#Node2.Sync_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Node2_Sync_Result'>Node2_Sync_Result</a></code>
</td>
</tr>
</table>
### UpdateAttributes {#Node2.UpdateAttributes}
<p>Updates information about the node.</p>
<ul>
<li><code>attributes</code> the presence of a table field in <code>attributes</code> indicates
the intent to update the corresponding attribute.</li>
</ul>
<p>This method requires the <a class='link' href='#Rights.UPDATE_ATTRIBUTES'>Rights.UPDATE_ATTRIBUTES</a> right.</p>
#### Request {#Node2.UpdateAttributes_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>payload</code></td>
<td>
<code><a class='link' href='#MutableNodeAttributes'>MutableNodeAttributes</a></code>
</td>
</tr>
</table>
#### Response {#Node2.UpdateAttributes_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Node2_UpdateAttributes_Result'>Node2_UpdateAttributes_Result</a></code>
</td>
</tr>
</table>
## Openable {#Openable}
*Defined in [fuchsia.io/directory.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory.fidl;l=182)*
### Open {#Openable.Open}
<p>Opens a new object relative to this directory object.</p>
<p><code>path</code> may contain multiple segments, separated by &quot;/&quot; characters, and should never be
empty; i.e. &quot;&quot; is an invalid path. A trailing slash implies OpenFlags.DIRECTORY. Components
must not be empty (i.e. &quot;foo//bar&quot; is invalid). &quot;..&quot; is disallowed anywhere in the path. &quot;.&quot;
is only allowed if the path is exactly &quot;.&quot;, but not otherwise. A leading '/' is allowed (and
is treated the same way as if not present, i.e. &quot;/foo/bar' and &quot;foo/bar&quot; are the same).</p>
<p>If an unknown value is sent for flags the connection should be closed.</p>
<p><code>OpenFlags.RIGHT_*</code> flags provided in <code>flags</code> will restrict access rights on
the <code>object</code> channel which will be connected to the opened entity.</p>
<p>Rights are never increased. When you open a nested entity within a directory, you may only
request the same rights as what the directory connection already has, or a subset of those.
Exceeding those rights causes an access denied error to be transmitted in the
<code>OnOpen</code> event if applicable, and the <code>object</code> connection closed.</p>
<p><code>mode</code> is ignored.</p>
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 12</span></div>
#### Request {#Openable.Open_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#OpenFlags'>OpenFlags</a></code>
</td>
</tr>
<tr>
<td><code>mode</code></td>
<td>
<code><a class='link' href='#ModeType'>ModeType</a></code>
</td>
</tr>
<tr>
<td><code>path</code></td>
<td>
<code>string[4095]</code>
</td>
</tr>
<tr>
<td><code>object</code></td>
<td>
<code>server_end&lt;<a class='link' href='#Node'>Node</a>&gt;</code>
</td>
</tr>
</table>
## Readable {#Readable}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=216)*
### Read {#Readable.Read}
<p>Reads up to 'count' bytes at the seek offset.
The seek offset is moved forward by the number of bytes read.</p>
<h2>Invariants</h2>
<ul>
<li>The returned <code>data.length</code> will never be greater than <code>count</code>.</li>
<li>If <code>data.length</code> is less than <code>count</code>, it means that the seek offset
has reached the end of file as part of this operation.</li>
<li>If <code>data.length</code> is zero while <code>count</code> is not, it means that the
seek offset is already at or beyond the end of file, and no data could
be read.</li>
<li>If <code>count</code> is zero, the server should perform all the checks ensuring
read access without actually read anything, and return an empty
<code>data</code> vector.</li>
</ul>
<p>This method requires the <a class='link' href='#Rights.READ_BYTES'>Rights.READ_BYTES</a> right.</p>
<p>Returns <code>ZX_ERR_OUT_OF_RANGE</code> if <code>count</code> is greater than <code>MAX_TRANSFER_SIZE</code>.</p>
#### Request {#Readable.Read_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>count</code></td>
<td>
<code>uint64</code>
</td>
</tr>
</table>
#### Response {#Readable.Read_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Readable_Read_Result'>Readable_Read_Result</a></code>
</td>
</tr>
</table>
## Writable {#Writable}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=243)*
### Write {#Writable.Write}
<p>Writes data at the seek offset.
The seek offset is moved forward by the number of bytes written.
If the file is in append mode, the seek offset is first set to the end
of the file, followed by the write, in one atomic step.</p>
<p>The file size may grow if the seek offset plus <code>data.length</code> is beyond
the current end of file.</p>
<ul>
<li>request <code>data</code> the byte buffer to write to the file.</li>
</ul>
<ul>
<li>response <code>actual_count</code> the number of bytes written.</li>
</ul>
<h2>Invariants</h2>
<ul>
<li>The returned <code>actual_count</code> will never be greater than <code>data.length</code>.</li>
<li>If the server is unable to write all the data due to e.g. not enough
space, <code>actual_count</code> may be less than <code>data.length</code>. If no bytes
could be written, an error is returned.</li>
<li>If <code>data.length</code> is zero, the server should perform all the checks
ensuring write access without mutating the file and return a
successful write of zero bytes. The seek offset is still updated if
in append mode.</li>
</ul>
<p>This method requires the <a class='link' href='#Rights.WRITE_BYTES'>Rights.WRITE_BYTES</a> right.</p>
#### Request {#Writable.Write_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>data</code></td>
<td>
<code><a class='link' href='#Transfer'>Transfer</a></code>
</td>
</tr>
</table>
#### Response {#Writable.Write_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Writable_Write_Result'>Writable_Write_Result</a></code>
</td>
</tr>
</table>
## **STRUCTS**
### AdvisoryLockRange {#AdvisoryLockRange data-text="AdvisoryLockRange"}
*Defined in [fuchsia.io/locking.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/locking.fidl;l=70)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="AdvisoryLockRange.origin">
<td><code>origin</code></td>
<td>
<code><a class='link' href='#SeekOrigin'>SeekOrigin</a></code>
</td>
<td><p>The location in the file from which <a class='link' href='#offset'>offset</a> is computed.</p>
</td>
<td>No default</td>
</tr>
<tr id="AdvisoryLockRange.offset">
<td><code>offset</code></td>
<td>
<code>int64</code>
</td>
<td><p>The start of the byte range, expressed as an offset from <a class='link' href='#origin'>origin</a>.
Cannot be negative if <a class='link' href='#origin'>origin</a> is <a class='link' href='#SeekOrigin.START'>SeekOrigin.START</a>.</p>
</td>
<td>No default</td>
</tr>
<tr id="AdvisoryLockRange.length">
<td><code>length</code></td>
<td>
<code>int64</code>
</td>
<td><p>The length of the byte range in bytes.</p>
<p>If the length is zero, then the byte range extends until the end of the
file, regardless of how large the file becomes.</p>
<p>If the length is negative, the byte range includes the bytes <code>offset</code> +
<code>length</code> up to, and including, <code>offset</code> - 1, provided this range does
not extend beyond the beginning of the file.</p>
</td>
<td>No default</td>
</tr>
</table>
### AdvisoryLocking_AdvisoryLock_Response {#AdvisoryLocking_AdvisoryLock_Response data-text="AdvisoryLocking_AdvisoryLock_Response"}
*Defined in [fuchsia.io/locking.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/locking.fidl;l=95)*
&lt;EMPTY&gt;
### Directory2_Rename_Response {#Directory2_Rename_Response data-text="Directory2_Rename_Response"}
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=271)*
&lt;EMPTY&gt;
### Directory2_Unlink_Response {#Directory2_Unlink_Response data-text="Directory2_Unlink_Response"}
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=240)*
&lt;EMPTY&gt;
### DirectoryIterator_GetNext_Response {#DirectoryIterator_GetNext_Response data-text="DirectoryIterator_GetNext_Response"}
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=23)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="DirectoryIterator_GetNext_Response.entries">
<td><code>entries</code></td>
<td>
<code>vector&lt;<a class='link' href='#DirectoryEntry'>DirectoryEntry</a>&gt;[8192]</code>
</td>
<td><p>Information about an immediate child node of a directory.</p>
<p>If a particular attribute is not applicable or not supported,
implementations should leave the corresponding field absent.</p>
</td>
<td>No default</td>
</tr>
</table>
### DirectoryObject {#DirectoryObject data-text="DirectoryObject"}
*Defined in [fuchsia.io/node.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node.fidl;l=116)*
&lt;EMPTY&gt;
### FileObject [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#FileObject data-text="FileObject"}
*Defined in [fuchsia.io/node.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node.fidl;l=100)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="FileObject.event">
<td><code>event</code></td>
<td>
<code>handle&lt;event&gt;?</code>
</td>
<td><p>An optional event which transmits information about an object's readability
or writability. This event relays information about the underlying object, not
the capability granted to client: this event may be signalled &quot;readable&quot; on a
connection that does not have the capability to read.</p>
<p>The &quot;<code>FILE_SIGNAL_</code>&quot; values may be observed on this event.</p>
</td>
<td>No default</td>
</tr>
<tr id="FileObject.stream">
<td><code>stream</code></td>
<td>
<code>handle&lt;stream&gt;?</code>
</td>
<td><p>A placeholder for future stream support.</p>
<p>Currently, servers are required not to send a handle in this field.</p>
</td>
<td>No default</td>
</tr>
</table>
### File_GetBackingMemory_Response [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#File_GetBackingMemory_Response data-text="File_GetBackingMemory_Response"}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=211)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="File_GetBackingMemory_Response.vmo">
<td><code>vmo</code></td>
<td>
<code>handle&lt;vmo&gt;</code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
### File_ReadAt_Response {#File_ReadAt_Response data-text="File_ReadAt_Response"}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=101)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="File_ReadAt_Response.data">
<td><code>data</code></td>
<td>
<code><a class='link' href='#Transfer'>Transfer</a></code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
### File_Resize_Response {#File_Resize_Response data-text="File_Resize_Response"}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=145)*
&lt;EMPTY&gt;
### File_Seek_Response {#File_Seek_Response data-text="File_Seek_Response"}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=76)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="File_Seek_Response.offset_from_start">
<td><code>offset_from_start</code></td>
<td>
<code>uint64</code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
### File_WriteAt_Response {#File_WriteAt_Response data-text="File_WriteAt_Response"}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=130)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="File_WriteAt_Response.actual_count">
<td><code>actual_count</code></td>
<td>
<code>uint64</code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
### FilesystemInfo {#FilesystemInfo data-text="FilesystemInfo"}
*Defined in [fuchsia.io/node.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node.fidl;l=166)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="FilesystemInfo.total_bytes">
<td><code>total_bytes</code></td>
<td>
<code>uint64</code>
</td>
<td><p>The number of data bytes which may be stored in a filesystem. This does not count
metadata or other filesystem overhead like block rounding.</p>
</td>
<td>No default</td>
</tr>
<tr id="FilesystemInfo.used_bytes">
<td><code>used_bytes</code></td>
<td>
<code>uint64</code>
</td>
<td><p>The number of data bytes which are in use by the filesystem. This does not count
metadata or other filesystem overhead like block rounding.</p>
</td>
<td>No default</td>
</tr>
<tr id="FilesystemInfo.total_nodes">
<td><code>total_nodes</code></td>
<td>
<code>uint64</code>
</td>
<td><p>The number of nodes which may be stored in the filesystem.</p>
</td>
<td>No default</td>
</tr>
<tr id="FilesystemInfo.used_nodes">
<td><code>used_nodes</code></td>
<td>
<code>uint64</code>
</td>
<td><p>The number of nodes used by the filesystem.</p>
</td>
<td>No default</td>
</tr>
<tr id="FilesystemInfo.free_shared_pool_bytes">
<td><code>free_shared_pool_bytes</code></td>
<td>
<code>uint64</code>
</td>
<td><p>The amount of additional space which may be allocated from the underlying volume
manager. If unsupported or there is no space for the filesystem to grow, this will
be zero.</p>
</td>
<td>No default</td>
</tr>
<tr id="FilesystemInfo.fs_id">
<td><code>fs_id</code></td>
<td>
<code>uint64</code>
</td>
<td><p>A unique identifier for this filesystem instance. Will not be preserved across
reboots.</p>
<p>Implementors should create a kernel object (normally an event) and use its koid for
the filesystem ID. This koid guarantees uniqueness in the system.</p>
</td>
<td>No default</td>
</tr>
<tr id="FilesystemInfo.block_size">
<td><code>block_size</code></td>
<td>
<code>uint32</code>
</td>
<td><p>The size in bytes of a single filesystem block.</p>
</td>
<td>No default</td>
</tr>
<tr id="FilesystemInfo.max_filename_size">
<td><code>max_filename_size</code></td>
<td>
<code>uint32</code>
</td>
<td><p>The maximum length of a filesystem name.</p>
</td>
<td>No default</td>
</tr>
<tr id="FilesystemInfo.fs_type">
<td><code>fs_type</code></td>
<td>
<code>uint32</code>
</td>
<td><p>A unique identifier for the type of the underlying filesystem.</p>
</td>
<td>No default</td>
</tr>
<tr id="FilesystemInfo.padding">
<td><code>padding</code></td>
<td>
<code>uint32</code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="FilesystemInfo.name">
<td><code>name</code></td>
<td>
<code>int8[32]</code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
### InotifyEvent {#InotifyEvent data-text="InotifyEvent"}
*Defined in [fuchsia.io/inotify.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/inotify.fidl;l=50)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="InotifyEvent.watch_descriptor">
<td><code>watch_descriptor</code></td>
<td>
<code>uint32</code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="InotifyEvent.mask">
<td><code>mask</code></td>
<td>
<code><a class='link' href='#InotifyWatchMask'>InotifyWatchMask</a></code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="InotifyEvent.cookie">
<td><code>cookie</code></td>
<td>
<code>uint32</code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="InotifyEvent.len">
<td><code>len</code></td>
<td>
<code>uint32</code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="InotifyEvent.filename">
<td><code>filename</code></td>
<td>
<code><a class='link' href='#Path'>Path</a></code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
### Node2_Sync_Response {#Node2_Sync_Response data-text="Node2_Sync_Response"}
*Defined in [fuchsia.io/node2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node2.fidl;l=224)*
&lt;EMPTY&gt;
### Node2_UpdateAttributes_Response {#Node2_UpdateAttributes_Response data-text="Node2_UpdateAttributes_Response"}
*Defined in [fuchsia.io/node2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node2.fidl;l=212)*
&lt;EMPTY&gt;
### NodeAttributes {#NodeAttributes data-text="NodeAttributes"}
*Defined in [fuchsia.io/node.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node.fidl;l=37)*
<p>NodeAttributes defines generic information about a filesystem node.</p>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="NodeAttributes.mode">
<td><code>mode</code></td>
<td>
<code>uint32</code>
</td>
<td><p>Protection bits and node type information describe in 'mode'.</p>
</td>
<td>No default</td>
</tr>
<tr id="NodeAttributes.id">
<td><code>id</code></td>
<td>
<code>uint64</code>
</td>
<td><p>A filesystem-unique ID.</p>
</td>
<td>No default</td>
</tr>
<tr id="NodeAttributes.content_size">
<td><code>content_size</code></td>
<td>
<code>uint64</code>
</td>
<td><p>Node size, in bytes.</p>
</td>
<td>No default</td>
</tr>
<tr id="NodeAttributes.storage_size">
<td><code>storage_size</code></td>
<td>
<code>uint64</code>
</td>
<td><p>Space needed to store node (possibly larger than size), in bytes.</p>
</td>
<td>No default</td>
</tr>
<tr id="NodeAttributes.link_count">
<td><code>link_count</code></td>
<td>
<code>uint64</code>
</td>
<td><p>Hard link count.</p>
</td>
<td>No default</td>
</tr>
<tr id="NodeAttributes.creation_time">
<td><code>creation_time</code></td>
<td>
<code>uint64</code>
</td>
<td><p>Time of creation (may be updated manually after creation) in ns since Unix epoch, UTC.</p>
</td>
<td>No default</td>
</tr>
<tr id="NodeAttributes.modification_time">
<td><code>modification_time</code></td>
<td>
<code>uint64</code>
</td>
<td><p>Time of last modification in ns since Unix epoch, UTC.</p>
</td>
<td>No default</td>
</tr>
</table>
### NodeAttributes2 {#NodeAttributes2 data-text="NodeAttributes2"}
*Defined in [fuchsia.io/node2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node2.fidl;l=176)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="NodeAttributes2.mutable_attributes">
<td><code>mutable_attributes</code></td>
<td>
<code><a class='link' href='#MutableNodeAttributes'>MutableNodeAttributes</a></code>
</td>
<td></td>
<td>No default</td>
</tr>
<tr id="NodeAttributes2.immutable_attributes">
<td><code>immutable_attributes</code></td>
<td>
<code><a class='link' href='#ImmutableNodeAttributes'>ImmutableNodeAttributes</a></code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
### Readable_Read_Response {#Readable_Read_Response data-text="Readable_Read_Response"}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=238)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Readable_Read_Response.data">
<td><code>data</code></td>
<td>
<code><a class='link' href='#Transfer'>Transfer</a></code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
### RightsRequest {#RightsRequest data-text="RightsRequest"}
*Defined in [fuchsia.io/rights-request.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/rights-request.fidl;l=71)*
<p>Options for requesting rights on the new connection.</p>
<h2>Rights Hierarchy</h2>
<p>Respecting principles of least privileges, rights in general must meet
the following restrictions:</p>
<ul>
<li>A connection must have nonzero rights.</li>
<li>From the perspective of a client, rights must never increase in a
derived connection.</li>
<li>From the perspective of a directory proxy, it must ensure that
new connections opened through it cannot have more rights than
the connection where the proxy received the <code>Open</code>/<code>Reopen</code> call.</li>
</ul>
<p>The proper enforcement of the rights hierarchy is a powerful refinement
over the existing access control facilities offered by directory
sandboxing.</p>
<h2>Rights vs Abilities</h2>
<p>The rights on a connection limits the set of operations allowed on that
connection, but does not guarantee their availability, because the
object may not support it.</p>
<p>See <a class='link' href='#Rights'>Rights</a> and <a class='link' href='#Abilities'>Abilities</a>.</p>
<h2>Implementation Notes</h2>
<p>When a directory proxy encounters an absent <code>rights</code> field, let <code>r</code> be
the rights on the connection where it received this request, the proxy
should fill in this field with the following:</p>
<pre><code>RightsRequest {
at_most: r,
at_least: 0,
resolution: RightsResolution.MAXIMIZE,
}
</code></pre>
<p>before forwarding the request to the remote party.</p>
<p>Because opening a new connection may involve multiple hops through
directory proxies, we require the client to set an upper bound and lower
bound on the rights request, and intermediate proxies to refine these
bounds.</p>
<p>The rights manipulation should be implemented mechanically
without knowledge of any specific rights, and servers should propagate
unknown bits members, to gracefully handle future rights extensions.</p>
<h2>Implementation Notes</h2>
<p>It could be common for a client to request an exact set of rights.
We recommend client libraries to define a helper function like follows:</p>
<pre><code>fn Exact(exact_rights: Rights) -&gt; RightsRequest {
RightsRequest {
at_most: exact_rights,
at_least: exact_rights,
resolution: RightsResolution.MAXIMIZE,
}
}
</code></pre>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="RightsRequest.at_most">
<td><code>at_most</code></td>
<td>
<code><a class='link' href='#Rights'>Rights</a></code>
</td>
<td><p>Sets an upper bound on the resulting rights. The exact rights will
depend on <code>resolution</code>.</p>
<h2>Implementation Notes</h2>
<p>When a directory proxy encounters this variant, it should compute the
intersection between this and the rights on the connection where it
received the request, to shrink the rights.</p>
<ul>
<li>If the intersection is empty, or not a superset of <code>at_least</code>,
the proxy should close <code>object_request</code> with the
<code>ZX_ERR_ACCESS_DENIED</code> epitaph.</li>
<li>Otherwise, the proxy should forward the <code>Open</code> call as usual,
but update <code>at_most</code> with the shrunk rights.</li>
</ul>
</td>
<td>No default</td>
</tr>
<tr id="RightsRequest.at_least">
<td><code>at_least</code></td>
<td>
<code><a class='link' href='#Rights'>Rights</a></code>
</td>
<td><p>Sets a lower bound on the resulting rights. The exact rights will
depend on <code>resolution</code>.</p>
<ul>
<li>During <a class='link' href='#Directory.Open'>Directory.Open</a>, you may only specify the same rights as
what the directory connection already has, or a subset of those.</li>
<li>During <a class='link' href='#Node.Reopen'>Node.Reopen</a>, similarly, you may only specify the same or
a subset of rights possessed by the original connection.</li>
<li>Exceeding those rights causes <code>object_request</code> to be closed with a
<code>ZX_ERR_ACCESS_DENIED</code> epitaph.</li>
</ul>
<p>Therefore there are these invariants which should be maintained:</p>
<pre><code>at_most ⊋ {}
at_most ⊃ at_least
rights_on_connection_where_open_is_received ⊋ {}
rights_on_connection_where_open_is_received ⊃ at_least
</code></pre>
<p>using the superset (<code>⊃</code>), proper superset (<code>⊋</code>),
and empty set (<code>{}</code>) notations.</p>
</td>
<td>No default</td>
</tr>
<tr id="RightsRequest.resolution">
<td><code>resolution</code></td>
<td>
<code><a class='link' href='#RightsResolution'>RightsResolution</a></code>
</td>
<td><p>When an <code>Open</code>/<code>Reopen</code> request reaches its final remote server, it should
assign rights on the new connection based on one of these modes.</p>
</td>
<td>No default</td>
</tr>
</table>
### Service {#Service data-text="Service"}
*Defined in [fuchsia.io/node.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node.fidl;l=97)*
&lt;EMPTY&gt;
### Writable_Write_Response {#Writable_Write_Response data-text="Writable_Write_Response"}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=270)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Writable_Write_Response.actual_count">
<td><code>actual_count</code></td>
<td>
<code>uint64</code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
## **ENUMS**
### AdvisoryLockType [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#AdvisoryLockType data-text="AdvisoryLockType"}
Type: <code>uint32</code>
*Defined in [fuchsia.io/locking.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/locking.fidl;l=51)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="AdvisoryLockType.READ">
<td><h3 id="AdvisoryLockType.READ" class="add-link hide-from-toc">READ</h3></td>
<td><code>1</code></td>
<td><p>Zero or more connections can hold read locks on a file simultaneously.</p>
</td>
</tr>
<tr id="AdvisoryLockType.WRITE">
<td><h3 id="AdvisoryLockType.WRITE" class="add-link hide-from-toc">WRITE</h3></td>
<td><code>2</code></td>
<td><p>At most one connection can hold a write lock on a file simultaneously.
When a write lock is held on a file, no other types of locks can be held
on that file.</p>
</td>
</tr>
<tr id="AdvisoryLockType.UNLOCK">
<td><h3 id="AdvisoryLockType.UNLOCK" class="add-link hide-from-toc">UNLOCK</h3></td>
<td><code>3</code></td>
<td><p>The region specifies a region to be unlocked.</p>
</td>
</tr>
</table>
### DirentType [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#DirentType data-text="DirentType"}
Type: <code>uint8</code>
*Defined in [fuchsia.io/directory.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory.fidl;l=112)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="DirentType.UNKNOWN">
<td><h3 id="DirentType.UNKNOWN" class="add-link hide-from-toc">UNKNOWN</h3></td>
<td><code>0</code></td>
<td><p>A dirent with an unknown type.</p>
</td>
</tr>
<tr id="DirentType.DIRECTORY">
<td><h3 id="DirentType.DIRECTORY" class="add-link hide-from-toc">DIRECTORY</h3></td>
<td><code>4</code></td>
<td><p>A dirent representing a directory object.</p>
</td>
</tr>
<tr id="DirentType.BLOCK_DEVICE">
<td><h3 id="DirentType.BLOCK_DEVICE" class="add-link hide-from-toc">BLOCK_DEVICE</h3></td>
<td><code>6</code></td>
<td><p>A dirent representing a block device object.</p>
</td>
</tr>
<tr id="DirentType.FILE">
<td><h3 id="DirentType.FILE" class="add-link hide-from-toc">FILE</h3></td>
<td><code>8</code></td>
<td><p>A dirent representing a file object.</p>
</td>
</tr>
<tr id="DirentType.SERVICE">
<td><h3 id="DirentType.SERVICE" class="add-link hide-from-toc">SERVICE</h3></td>
<td><code>16</code></td>
<td><p>A dirent representing a service object.</p>
</td>
</tr>
</table>
### OpenMode [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#OpenMode data-text="OpenMode"}
Type: <code>uint32</code>
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=146)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="OpenMode.OPEN_EXISTING">
<td><h3 id="OpenMode.OPEN_EXISTING" class="add-link hide-from-toc">OPEN_EXISTING</h3></td>
<td><code>1</code></td>
<td><p>Only succeed if the object exists.</p>
</td>
</tr>
<tr id="OpenMode.MAYBE_CREATE">
<td><h3 id="OpenMode.MAYBE_CREATE" class="add-link hide-from-toc">MAYBE_CREATE</h3></td>
<td><code>2</code></td>
<td><p>Create the object if it does not exist, otherwise open
existing. The check and the creation are performed in
one atomic step.</p>
</td>
</tr>
<tr id="OpenMode.ALWAYS_CREATE">
<td><h3 id="OpenMode.ALWAYS_CREATE" class="add-link hide-from-toc">ALWAYS_CREATE</h3></td>
<td><code>3</code></td>
<td><p>Assert that the object does not exist, then create it.
The assertion and creation are performed in one atomic
step.</p>
</td>
</tr>
</table>
### RightsResolution [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#RightsResolution data-text="RightsResolution"}
Type: <code>uint32</code>
*Defined in [fuchsia.io/rights-request.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/rights-request.fidl;l=113)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="RightsResolution.MAXIMIZE">
<td><h3 id="RightsResolution.MAXIMIZE" class="add-link hide-from-toc">MAXIMIZE</h3></td>
<td><code>1</code></td>
<td><p>The rights will be the intersection between <a class='link' href='#RightsRequest.at_most'>RightsRequest.at_most</a>
and the connection where the <code>Open</code>/<code>Reopen</code> request was received,
closing <code>object_request</code> with <code>ZX_ERR_ACCESS_DENIED</code> if it is empty.</p>
</td>
</tr>
<tr id="RightsResolution.POSIX">
<td><h3 id="RightsResolution.POSIX" class="add-link hide-from-toc">POSIX</h3></td>
<td><code>2</code></td>
<td><p>The rights will be determined by the following rules:</p>
<ul>
<li>If the negotiated protocol on the new connection is
<a class='link' href='#Directory'>Directory</a>, the rules from the <code>MAXIMIZE</code> case applies.</li>
<li>Otherwise, the rights will be <a class='link' href='#RightsRequest.at_least'>RightsRequest.at_least</a> if it
does not exceed rights on the current connection.</li>
<li>Otherwise, <code>object_request</code> should be closed with
<code>ZX_ERR_ACCESS_DENIED</code>.</li>
</ul>
<p>The motivation for this enum is to facilitate implementing POSIX
compatibility layers. The POSIX file permission model relies on ambient
authority: access control on files are resolved based on the <code>mode</code> of
the file, and the current user. There is no concept of hierarchical
permissions. Fuchsia, on the other hand, restricts rights on file
connections to never exceed that of its containing directory connection.</p>
</td>
</tr>
</table>
### SeekOrigin [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#SeekOrigin data-text="SeekOrigin"}
Type: <code>uint32</code>
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=278)*
<p>The reference point for updating the seek offset. See <a class='link' href='#File.Seek'>File.Seek</a>.</p>
<p>This enum matches the <code>zx_stream_seek_origin_t</code> enum.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="SeekOrigin.START">
<td><h3 id="SeekOrigin.START" class="add-link hide-from-toc">START</h3></td>
<td><code>0</code></td>
<td><p>Seek from the start of the file.
The seek offset will be set to <code>offset</code> bytes.
The seek offset cannot be negative in this case.</p>
</td>
</tr>
<tr id="SeekOrigin.CURRENT">
<td><h3 id="SeekOrigin.CURRENT" class="add-link hide-from-toc">CURRENT</h3></td>
<td><code>1</code></td>
<td><p>Seek from the current position in the file.
The seek offset will be the current seek offset plus <code>offset</code> bytes.</p>
</td>
</tr>
<tr id="SeekOrigin.END">
<td><h3 id="SeekOrigin.END" class="add-link hide-from-toc">END</h3></td>
<td><code>2</code></td>
<td><p>Seek from the end of the file.
The seek offset will be the file size plus <code>offset</code> bytes.</p>
</td>
</tr>
</table>
### WatchEvent [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#WatchEvent data-text="WatchEvent"}
Type: <code>uint8</code>
*Defined in [fuchsia.io/directory.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory.fidl;l=148)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="WatchEvent.DELETED">
<td><h3 id="WatchEvent.DELETED" class="add-link hide-from-toc">DELETED</h3></td>
<td><code>0</code></td>
<td><p>Indicates the directory being watched has been deleted. The name returned for this event
will be <code>.</code> (dot), as it is refering to the directory itself.</p>
</td>
</tr>
<tr id="WatchEvent.ADDED">
<td><h3 id="WatchEvent.ADDED" class="add-link hide-from-toc">ADDED</h3></td>
<td><code>1</code></td>
<td><p>Indicates a node has been created (either new or moved) into a directory.</p>
</td>
</tr>
<tr id="WatchEvent.REMOVED">
<td><h3 id="WatchEvent.REMOVED" class="add-link hide-from-toc">REMOVED</h3></td>
<td><code>2</code></td>
<td><p>Identifies a node has been removed (either deleted or moved) from the directory.</p>
</td>
</tr>
<tr id="WatchEvent.EXISTING">
<td><h3 id="WatchEvent.EXISTING" class="add-link hide-from-toc">EXISTING</h3></td>
<td><code>3</code></td>
<td><p>Identifies a node already existed in the directory when watching started.</p>
</td>
</tr>
<tr id="WatchEvent.IDLE">
<td><h3 id="WatchEvent.IDLE" class="add-link hide-from-toc">IDLE</h3></td>
<td><code>4</code></td>
<td><p>Identifies that no more <code>EXISTING</code> events will be sent. The name returned for this event
will be empty, as it is not refering to a specific entry.</p>
</td>
</tr>
</table>
## **TABLES**
### AdvisoryLockRequest {#AdvisoryLockRequest data-text="AdvisoryLockRequest"}
*Defined in [fuchsia.io/locking.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/locking.fidl;l=46)*
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="AdvisoryLockRequest.type">
<td><h3 id="AdvisoryLockRequest.type" class="add-link hide-from-toc">1</h3></td>
<td><code>type</code></td>
<td>
<code><a class='link' href='#AdvisoryLockType'>AdvisoryLockType</a></code>
</td>
<td><p>The type of lock to be acquired.</p>
<p>If this field is absent, the <a class='link' href='#AdvisoryLock'>AdvisoryLock</a> method will fail
with ZX_ERR_INVALID_ARGS.</p>
</td>
</tr>
<tr id="AdvisoryLockRequest.range">
<td><h3 id="AdvisoryLockRequest.range" class="add-link hide-from-toc">2</h3></td>
<td><code>range</code></td>
<td>
<code><a class='link' href='#AdvisoryLockRange'>AdvisoryLockRange</a></code>
</td>
<td><p>The byte range within the file to be locked.</p>
<p>The range can extend beyond the end of the file but cannot extend beyond
the beginning of the file.</p>
<p>If this field is absent, the range defaults to the entire file.</p>
</td>
</tr>
<tr id="AdvisoryLockRequest.wait">
<td><h3 id="AdvisoryLockRequest.wait" class="add-link hide-from-toc">3</h3></td>
<td><code>wait</code></td>
<td>
<code>bool</code>
</td>
<td><p>Whether the file should wait reply to the <a class='link' href='#AdvisoryLock'>AdvisoryLock</a>
method until the requested lock can be acquired.</p>
<p>If this field is absent, the file will not wait.</p>
</td>
</tr>
</table>
### ConnectionInfo [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#ConnectionInfo data-text="ConnectionInfo"}
*Defined in [fuchsia.io/node2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node2.fidl;l=18)*
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="ConnectionInfo.rights">
<td><h3 id="ConnectionInfo.rights" class="add-link hide-from-toc">1</h3></td>
<td><code>rights</code></td>
<td>
<code><a class='link' href='#Rights'>Rights</a></code>
</td>
<td><p>The rights possessed by the current connection. Note: <code>rights</code> limits
the set of operations allowed on the connection, but does not guarantee
their availability. For example, one may have the <a class='link' href='#Rights.EXECUTE'>Rights.EXECUTE</a>
right on a file connection, but the file itself does not have the
<code>EXECUTE</code> ability, and hence cannot be executed. See
<a class='link' href='#ConnectionOptions.rights'>ConnectionOptions.rights</a>.</p>
</td>
</tr>
</table>
### ConnectorInfo {#ConnectorInfo data-text="ConnectorInfo"}
*Defined in [fuchsia.io/node2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node2.fidl;l=97)*
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
</table>
### DirectoryEntry {#DirectoryEntry data-text="DirectoryEntry"}
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=28)*
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="DirectoryEntry.name">
<td><h3 id="DirectoryEntry.name" class="add-link hide-from-toc">1</h3></td>
<td><code>name</code></td>
<td>
<code><a class='link' href='#Name'>Name</a></code>
</td>
<td><p>Name of the node. This field must be present.</p>
</td>
</tr>
<tr id="DirectoryEntry.protocols">
<td><h3 id="DirectoryEntry.protocols" class="add-link hide-from-toc">2</h3></td>
<td><code>protocols</code></td>
<td>
<code><a class='link' href='#NodeProtocolKinds'>NodeProtocolKinds</a></code>
</td>
<td><p>Describes the kinds of representations supported by the node.</p>
</td>
</tr>
<tr id="DirectoryEntry.abilities">
<td><h3 id="DirectoryEntry.abilities" class="add-link hide-from-toc">3</h3></td>
<td><code>abilities</code></td>
<td>
<code><a class='link' href='#Abilities'>Abilities</a></code>
</td>
<td><p>Describes the kinds of operations supported by the node.</p>
</td>
</tr>
<tr id="DirectoryEntry.id">
<td><h3 id="DirectoryEntry.id" class="add-link hide-from-toc">4</h3></td>
<td><code>id</code></td>
<td>
<code><a class='link' href='#Id'>Id</a></code>
</td>
<td><p>An ID for the node. See <a class='link' href='#Id'>Id</a>.
This <code>id</code> should be unique among all entries of a directory.</p>
</td>
</tr>
</table>
### DirectoryEnumerateOptions {#DirectoryEnumerateOptions data-text="DirectoryEnumerateOptions"}
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=249)*
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
</table>
### DirectoryInfo {#DirectoryInfo data-text="DirectoryInfo"}
*Defined in [fuchsia.io/node2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node2.fidl;l=104)*
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
</table>
### FileInfo [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#FileInfo data-text="FileInfo"}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=18)*
<p>Auxiliary data for the file representation of a node.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="FileInfo.is_append">
<td><h3 id="FileInfo.is_append" class="add-link hide-from-toc">1</h3></td>
<td><code>is_append</code></td>
<td>
<code>bool</code>
</td>
<td><p>True if the file is opened in append mode.
In append mode, the seek offset is moved to the end before every
write, the two steps performed in an atomic manner.</p>
</td>
</tr>
<tr id="FileInfo.observer">
<td><h3 id="FileInfo.observer" class="add-link hide-from-toc">2</h3></td>
<td><code>observer</code></td>
<td>
<code>handle&lt;event&gt;</code>
</td>
<td><p>An optional event which transmits information about an object's
readability or writability. This event relays information about the
underlying object, not the capability granted to client: this event
may be signalled &quot;readable&quot; on a connection that does not have
the capability to read.</p>
<p>This event will be present if the following conditions are met:</p>
<ul>
<li>The <code>available_operations</code> on the file connection is not empty.</li>
<li>The filesystem supports signalling readability/writability events.</li>
</ul>
<p>The <a class='link' href='#FileSignal'>FileSignal</a> values may be observed on this event.</p>
</td>
</tr>
<tr id="FileInfo.stream">
<td><h3 id="FileInfo.stream" class="add-link hide-from-toc">3</h3></td>
<td><code>stream</code></td>
<td>
<code>handle&lt;stream&gt;</code>
</td>
<td><p>An optional stream object, which can be used to read to and write from
the file.</p>
<p>Reading and writing the file using the stream object can be up to 20x
faster than reading and writing the file using the Read and Write
operations in the <a class='link' href='#File'>File</a> protocol.</p>
</td>
</tr>
</table>
### ImmutableNodeAttributes {#ImmutableNodeAttributes data-text="ImmutableNodeAttributes"}
*Defined in [fuchsia.io/node2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node2.fidl;l=180)*
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="ImmutableNodeAttributes.protocols">
<td><h3 id="ImmutableNodeAttributes.protocols" class="add-link hide-from-toc">1</h3></td>
<td><code>protocols</code></td>
<td>
<code><a class='link' href='#NodeProtocolKinds'>NodeProtocolKinds</a></code>
</td>
<td><p>Describes the kinds of representations supported by the node.
Note: This is not the result of the connection-time negotiation,
which is conveyed via <code>representation</code>.</p>
</td>
</tr>
<tr id="ImmutableNodeAttributes.abilities">
<td><h3 id="ImmutableNodeAttributes.abilities" class="add-link hide-from-toc">2</h3></td>
<td><code>abilities</code></td>
<td>
<code><a class='link' href='#Abilities'>Abilities</a></code>
</td>
<td><p>Describes the kinds of operations supported by the node.
Note: This is distinct from the rights used at connection time.</p>
</td>
</tr>
<tr id="ImmutableNodeAttributes.content_size">
<td><h3 id="ImmutableNodeAttributes.content_size" class="add-link hide-from-toc">3</h3></td>
<td><code>content_size</code></td>
<td>
<code>uint64</code>
</td>
<td><p>Node size, in bytes.</p>
</td>
</tr>
<tr id="ImmutableNodeAttributes.storage_size">
<td><h3 id="ImmutableNodeAttributes.storage_size" class="add-link hide-from-toc">4</h3></td>
<td><code>storage_size</code></td>
<td>
<code>uint64</code>
</td>
<td><p>Space needed to store the node (possibly larger than size), in bytes.</p>
</td>
</tr>
<tr id="ImmutableNodeAttributes.link_count">
<td><h3 id="ImmutableNodeAttributes.link_count" class="add-link hide-from-toc">5</h3></td>
<td><code>link_count</code></td>
<td>
<code>uint64</code>
</td>
<td><p>Number of hard links to the node. It must be at least one.</p>
</td>
</tr>
<tr id="ImmutableNodeAttributes.id">
<td><h3 id="ImmutableNodeAttributes.id" class="add-link hide-from-toc">6</h3></td>
<td><code>id</code></td>
<td>
<code><a class='link' href='#Id'>Id</a></code>
</td>
<td><p>An ID for the node. See <a class='link' href='#Id'>Id</a>.
This <code>id</code> should be unique among all entries of a directory.</p>
</td>
</tr>
</table>
### MutableNodeAttributes {#MutableNodeAttributes data-text="MutableNodeAttributes"}
*Defined in [fuchsia.io/node2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node2.fidl;l=9)*
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="MutableNodeAttributes.creation_time">
<td><h3 id="MutableNodeAttributes.creation_time" class="add-link hide-from-toc">1</h3></td>
<td><code>creation_time</code></td>
<td>
<code>uint64</code>
</td>
<td><p>Time of creation in nanoseconds since the Unix epoch, UTC.</p>
</td>
</tr>
<tr id="MutableNodeAttributes.modification_time">
<td><h3 id="MutableNodeAttributes.modification_time" class="add-link hide-from-toc">2</h3></td>
<td><code>modification_time</code></td>
<td>
<code>uint64</code>
</td>
<td><p>Time of last modification in nanoseconds since the Unix epoch, UTC.</p>
</td>
</tr>
</table>
### NodeOptions {#NodeOptions data-text="NodeOptions"}
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=83)*
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="NodeOptions.flags">
<td><h3 id="NodeOptions.flags" class="add-link hide-from-toc">1</h3></td>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#NodeFlags'>NodeFlags</a></code>
</td>
<td></td>
</tr>
<tr id="NodeOptions.protocols">
<td><h3 id="NodeOptions.protocols" class="add-link hide-from-toc">2</h3></td>
<td><code>protocols</code></td>
<td>
<code><a class='link' href='#NodeProtocols'>NodeProtocols</a></code>
</td>
<td><p>Callers may assert the type of the object by setting the
protocol corresponding to the expected type:</p>
<ul>
<li>
<p>If the caller expected a directory but the node cannot be
accessed as a directory, the error is <code>ZX_ERR_NOT_DIR</code>.</p>
</li>
<li>
<p>If the caller expected a file but the node cannot be
accessed as a file, the error is <code>ZX_ERR_NOT_FILE</code>.</p>
</li>
<li>
<p>In other mismatched cases, the error is
<code>ZX_ERR_WRONG_TYPE</code>.</p>
</li>
</ul>
<p>If more than one protocol is present, the resultant protocol
may become any one of them. Callers should specify
<a class='link' href='#NodeFlags.GET_REPRESENTATION'>NodeFlags.GET_REPRESENTATION</a> to receive a
<a class='link' href='#Node.OnRepresentation'>Node.OnRepresentation</a> event, in order to ascertain the
protocol.</p>
<p>If absent, indicates that the caller accepts any <a class='link' href='#Node'>Node</a>
protocol (including <a class='link' href='#Node'>Node</a> itself for connector nodes, for
instance).</p>
</td>
</tr>
<tr id="NodeOptions.mode">
<td><h3 id="NodeOptions.mode" class="add-link hide-from-toc">3</h3></td>
<td><code>mode</code></td>
<td>
<code><a class='link' href='#OpenMode'>OpenMode</a></code>
</td>
<td><p>Specifies behavior with respect to existence. If an object
is to be created, its type is specified by <code>protocols</code>; it
must be present. If a valid object type cannot be
unambiguously inferred e.g. both <code>directory</code> and <code>file</code> are
set, the request must fail.</p>
</td>
</tr>
<tr id="NodeOptions.rights_request">
<td><h3 id="NodeOptions.rights_request" class="add-link hide-from-toc">4</h3></td>
<td><code>rights_request</code></td>
<td>
<code><a class='link' href='#RightsRequest'>RightsRequest</a></code>
</td>
<td><p>Requests rights on the new connection according to the
specified rules.</p>
<p>If absent, inherits at most the rights from the connection
where the <code>Open</code> call is made. If the path crosses
intermediate proxies, a proxy may strip elements from the
resulting rights if the intermediate connection does not
have the corresponding rights.</p>
</td>
</tr>
</table>
### NodeProtocols {#NodeProtocols data-text="NodeProtocols"}
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=116)*
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="NodeProtocols.directory">
<td><h3 id="NodeProtocols.directory" class="add-link hide-from-toc">1</h3></td>
<td><code>directory</code></td>
<td>
<code><a class='link' href='#DirectoryProtocolFlags'>DirectoryProtocolFlags</a></code>
</td>
<td></td>
</tr>
<tr id="NodeProtocols.file">
<td><h3 id="NodeProtocols.file" class="add-link hide-from-toc">2</h3></td>
<td><code>file</code></td>
<td>
<code><a class='link' href='#FileProtocolFlags'>FileProtocolFlags</a></code>
</td>
<td></td>
</tr>
</table>
### UnlinkOptions {#UnlinkOptions data-text="UnlinkOptions"}
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=233)*
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="UnlinkOptions.flags">
<td><h3 id="UnlinkOptions.flags" class="add-link hide-from-toc">1</h3></td>
<td><code>flags</code></td>
<td>
<code><a class='link' href='#UnlinkFlags'>UnlinkFlags</a></code>
</td>
<td></td>
</tr>
</table>
## **UNIONS**
### AdvisoryLocking_AdvisoryLock_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#AdvisoryLocking_AdvisoryLock_Result data-text="AdvisoryLocking_AdvisoryLock_Result"}
*Defined in [fuchsia.io/locking.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/locking.fidl;l=95)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="AdvisoryLocking_AdvisoryLock_Result.response">
<td><h3 id="AdvisoryLocking_AdvisoryLock_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#AdvisoryLocking_AdvisoryLock_Response'>AdvisoryLocking_AdvisoryLock_Response</a></code>
</td>
<td></td>
</tr>
<tr id="AdvisoryLocking_AdvisoryLock_Result.err">
<td><h3 id="AdvisoryLocking_AdvisoryLock_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
<td></td>
</tr>
</table>
### ConnectionProtocols [flexible](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#ConnectionProtocols data-text="ConnectionProtocols"}
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=76)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="ConnectionProtocols.connector">
<td><h3 id="ConnectionProtocols.connector" class="add-link hide-from-toc">1</h3></td>
<td><code>connector</code></td>
<td>
<code><a class='link' href='#ConnectorFlags'>ConnectorFlags</a></code>
</td>
<td><p>Requests that the node's underlying protocol be served on the
connection.</p>
</td>
</tr>
<tr id="ConnectionProtocols.node">
<td><h3 id="ConnectionProtocols.node" class="add-link hide-from-toc">2</h3></td>
<td><code>node</code></td>
<td>
<code><a class='link' href='#NodeOptions'>NodeOptions</a></code>
</td>
<td><p>Requests that the underlying <a class='link' href='#Node'>Node</a> protocol be served on the
connection.</p>
</td>
</tr>
</table>
### Directory2_Rename_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Directory2_Rename_Result data-text="Directory2_Rename_Result"}
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=271)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Directory2_Rename_Result.response">
<td><h3 id="Directory2_Rename_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#Directory2_Rename_Response'>Directory2_Rename_Response</a></code>
</td>
<td></td>
</tr>
<tr id="Directory2_Rename_Result.err">
<td><h3 id="Directory2_Rename_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
<td></td>
</tr>
</table>
### Directory2_Unlink_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Directory2_Unlink_Result data-text="Directory2_Unlink_Result"}
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=240)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Directory2_Unlink_Result.response">
<td><h3 id="Directory2_Unlink_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#Directory2_Unlink_Response'>Directory2_Unlink_Response</a></code>
</td>
<td></td>
</tr>
<tr id="Directory2_Unlink_Result.err">
<td><h3 id="Directory2_Unlink_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
<td></td>
</tr>
</table>
### DirectoryIterator_GetNext_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#DirectoryIterator_GetNext_Result data-text="DirectoryIterator_GetNext_Result"}
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=23)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="DirectoryIterator_GetNext_Result.response">
<td><h3 id="DirectoryIterator_GetNext_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#DirectoryIterator_GetNext_Response'>DirectoryIterator_GetNext_Response</a></code>
</td>
<td></td>
</tr>
<tr id="DirectoryIterator_GetNext_Result.err">
<td><h3 id="DirectoryIterator_GetNext_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
<td></td>
</tr>
</table>
### File_GetBackingMemory_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#File_GetBackingMemory_Result data-text="File_GetBackingMemory_Result"}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=211)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="File_GetBackingMemory_Result.response">
<td><h3 id="File_GetBackingMemory_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#File_GetBackingMemory_Response'>File_GetBackingMemory_Response</a></code>
</td>
<td></td>
</tr>
<tr id="File_GetBackingMemory_Result.err">
<td><h3 id="File_GetBackingMemory_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
<td></td>
</tr>
</table>
### File_ReadAt_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#File_ReadAt_Result data-text="File_ReadAt_Result"}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=101)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="File_ReadAt_Result.response">
<td><h3 id="File_ReadAt_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#File_ReadAt_Response'>File_ReadAt_Response</a></code>
</td>
<td></td>
</tr>
<tr id="File_ReadAt_Result.err">
<td><h3 id="File_ReadAt_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
<td></td>
</tr>
</table>
### File_Resize_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#File_Resize_Result data-text="File_Resize_Result"}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=145)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="File_Resize_Result.response">
<td><h3 id="File_Resize_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#File_Resize_Response'>File_Resize_Response</a></code>
</td>
<td></td>
</tr>
<tr id="File_Resize_Result.err">
<td><h3 id="File_Resize_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
<td></td>
</tr>
</table>
### File_Seek_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#File_Seek_Result data-text="File_Seek_Result"}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=76)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="File_Seek_Result.response">
<td><h3 id="File_Seek_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#File_Seek_Response'>File_Seek_Response</a></code>
</td>
<td></td>
</tr>
<tr id="File_Seek_Result.err">
<td><h3 id="File_Seek_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
<td></td>
</tr>
</table>
### File_WriteAt_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#File_WriteAt_Result data-text="File_WriteAt_Result"}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=130)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="File_WriteAt_Result.response">
<td><h3 id="File_WriteAt_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#File_WriteAt_Response'>File_WriteAt_Response</a></code>
</td>
<td></td>
</tr>
<tr id="File_WriteAt_Result.err">
<td><h3 id="File_WriteAt_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
<td></td>
</tr>
</table>
### Node2_GetAttributes_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Node2_GetAttributes_Result data-text="Node2_GetAttributes_Result"}
*Defined in [fuchsia.io/node2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node2.fidl;l=176)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Node2_GetAttributes_Result.response">
<td><h3 id="Node2_GetAttributes_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#NodeAttributes2'>NodeAttributes2</a></code>
</td>
<td></td>
</tr>
<tr id="Node2_GetAttributes_Result.err">
<td><h3 id="Node2_GetAttributes_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
<td></td>
</tr>
</table>
### Node2_Sync_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Node2_Sync_Result data-text="Node2_Sync_Result"}
*Defined in [fuchsia.io/node2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node2.fidl;l=224)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Node2_Sync_Result.response">
<td><h3 id="Node2_Sync_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#Node2_Sync_Response'>Node2_Sync_Response</a></code>
</td>
<td></td>
</tr>
<tr id="Node2_Sync_Result.err">
<td><h3 id="Node2_Sync_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
<td></td>
</tr>
</table>
### Node2_UpdateAttributes_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Node2_UpdateAttributes_Result data-text="Node2_UpdateAttributes_Result"}
*Defined in [fuchsia.io/node2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node2.fidl;l=212)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Node2_UpdateAttributes_Result.response">
<td><h3 id="Node2_UpdateAttributes_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#Node2_UpdateAttributes_Response'>Node2_UpdateAttributes_Response</a></code>
</td>
<td></td>
</tr>
<tr id="Node2_UpdateAttributes_Result.err">
<td><h3 id="Node2_UpdateAttributes_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
<td></td>
</tr>
</table>
### NodeInfoDeprecated [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#NodeInfoDeprecated data-text="NodeInfoDeprecated"}
*Defined in [fuchsia.io/node.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node.fidl;l=95)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="NodeInfoDeprecated.service">
<td><h3 id="NodeInfoDeprecated.service" class="add-link hide-from-toc">1</h3></td>
<td><code>service</code></td>
<td>
<code><a class='link' href='#Service'>Service</a></code>
</td>
<td><p>No protocol information was supplied by the connection.</p>
</td>
</tr>
<tr id="NodeInfoDeprecated.file">
<td><h3 id="NodeInfoDeprecated.file" class="add-link hide-from-toc">2</h3></td>
<td><code>file</code></td>
<td>
<code><a class='link' href='#FileObject'>FileObject</a></code>
</td>
<td><p>The connection composes <a class='link' href='#File'>File</a>.</p>
</td>
</tr>
<tr id="NodeInfoDeprecated.directory">
<td><h3 id="NodeInfoDeprecated.directory" class="add-link hide-from-toc">3</h3></td>
<td><code>directory</code></td>
<td>
<code><a class='link' href='#DirectoryObject'>DirectoryObject</a></code>
</td>
<td><p>The connection composes <a class='link' href='#Directory'>Directory</a>.</p>
</td>
</tr>
</table>
### Readable_Read_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Readable_Read_Result data-text="Readable_Read_Result"}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=238)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Readable_Read_Result.response">
<td><h3 id="Readable_Read_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#Readable_Read_Response'>Readable_Read_Response</a></code>
</td>
<td></td>
</tr>
<tr id="Readable_Read_Result.err">
<td><h3 id="Readable_Read_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
<td></td>
</tr>
</table>
### Representation [flexible](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Representation data-text="Representation"}
*Defined in [fuchsia.io/node2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node2.fidl;l=88)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Representation.connector">
<td><h3 id="Representation.connector" class="add-link hide-from-toc">1</h3></td>
<td><code>connector</code></td>
<td>
<code><a class='link' href='#ConnectorInfo'>ConnectorInfo</a></code>
</td>
<td><p>Auxiliary data for the connector representation of a node, used
for protocol discovery and connection.</p>
<p>It supports connecting to arbitrary protocols exported by the
filesystem server at a path, including ones that do not compose
<a class='link' href='#Node2'>Node2</a>.</p>
<p>See <a class='link' href='#NodeProtocolKinds.CONNECTOR'>NodeProtocolKinds.CONNECTOR</a>.</p>
</td>
</tr>
<tr id="Representation.directory">
<td><h3 id="Representation.directory" class="add-link hide-from-toc">2</h3></td>
<td><code>directory</code></td>
<td>
<code><a class='link' href='#DirectoryInfo'>DirectoryInfo</a></code>
</td>
<td><p>Auxiliary data for the directory representation of a node. The
selection of this variant in <a class='link' href='#Representation'>Representation</a> implies that the
connection speaks the <a class='link' href='#Directory'>Directory</a> protocol.</p>
<p>See <a class='link' href='#NodeProtocolKinds.DIRECTORY'>NodeProtocolKinds.DIRECTORY</a>.</p>
</td>
</tr>
<tr id="Representation.file">
<td><h3 id="Representation.file" class="add-link hide-from-toc">3</h3></td>
<td><code>file</code></td>
<td>
<code><a class='link' href='#FileInfo'>FileInfo</a></code>
</td>
<td><p>Auxiliary data for the file representation of a node. The
selection of this variant in <a class='link' href='#Representation'>Representation</a> implies that the
connection speaks the <a class='link' href='#File'>File</a> protocol.</p>
<p>See <a class='link' href='#NodeProtocolKinds.FILE'>NodeProtocolKinds.FILE</a>.</p>
</td>
</tr>
</table>
### Writable_Write_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Writable_Write_Result data-text="Writable_Write_Result"}
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=270)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Writable_Write_Result.response">
<td><h3 id="Writable_Write_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#Writable_Write_Response'>Writable_Write_Response</a></code>
</td>
<td></td>
</tr>
<tr id="Writable_Write_Result.err">
<td><h3 id="Writable_Write_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
<td></td>
</tr>
</table>
## **BITS**
### ConnectorFlags [flexible](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#ConnectorFlags}
Type: <code>uint64</code>
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=79)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
</table>
### DirectoryProtocolFlags [flexible](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#DirectoryProtocolFlags}
Type: <code>uint64</code>
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=119)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
</table>
### FileProtocolFlags [flexible](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#FileProtocolFlags}
Type: <code>uint64</code>
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=120)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="FileProtocolFlags.APPEND">
<td><h3 id="FileProtocolFlags.APPEND" class="add-link hide-from-toc">APPEND</h3></td>
<td>1</td>
<td><p>Opens the file in append mode, i.e. the connection
should seek to the end of the file before every
write.</p>
<p>If the file does not support appending, it should
result in a <code>ZX_ERR_NOT_SUPPORTED</code> epitaph.
Currently, only <a class='link' href='#fileProtocols.FILE'>fileProtocols.FILE</a> connections
may be configured for appending.</p>
</td>
</tr>
<tr id="FileProtocolFlags.TRUNCATE">
<td><h3 id="FileProtocolFlags.TRUNCATE" class="add-link hide-from-toc">TRUNCATE</h3></td>
<td>2</td>
<td><p>Truncates the object before usage, by setting its
length to 0. Requires the <a class='link' href='#Rights.WRITE_BYTES'>Rights.WRITE_BYTES</a>
right on the connection.</p>
<p>If the file does not support truncating, it should
result in a <code>ZX_ERR_NOT_SUPPORTED</code> epitaph.</p>
</td>
</tr>
</table>
### FileSignal [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#FileSignal}
Type: <code>uint32</code>
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=293)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="FileSignal.READABLE">
<td><h3 id="FileSignal.READABLE" class="add-link hide-from-toc">READABLE</h3></td>
<td>16777216</td>
<td><p>Indicates the file is ready for reading.</p>
</td>
</tr>
<tr id="FileSignal.WRITABLE">
<td><h3 id="FileSignal.WRITABLE" class="add-link hide-from-toc">WRITABLE</h3></td>
<td>33554432</td>
<td><p>Indicates the file is ready for writing.</p>
</td>
</tr>
</table>
### InotifyWatchMask [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#InotifyWatchMask}
Type: <code>uint32</code>
*Defined in [fuchsia.io/inotify.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/inotify.fidl;l=17)*
<p>Used by InotifyAddWatch to indicate the server the events to be watched on.
Also used by <a class='link' href='#Node.Inotify'>Node.Inotify</a> to indicate the types of events
that occurred on server side, to be notified to clients. See InotifyEvent.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="InotifyWatchMask.ACCESS">
<td><h3 id="InotifyWatchMask.ACCESS" class="add-link hide-from-toc">ACCESS</h3></td>
<td>1</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.MODIFY">
<td><h3 id="InotifyWatchMask.MODIFY" class="add-link hide-from-toc">MODIFY</h3></td>
<td>2</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.ATTRIB">
<td><h3 id="InotifyWatchMask.ATTRIB" class="add-link hide-from-toc">ATTRIB</h3></td>
<td>4</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.CLOSE_WRITE">
<td><h3 id="InotifyWatchMask.CLOSE_WRITE" class="add-link hide-from-toc">CLOSE_WRITE</h3></td>
<td>8</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.CLOSE_NOWRITE">
<td><h3 id="InotifyWatchMask.CLOSE_NOWRITE" class="add-link hide-from-toc">CLOSE_NOWRITE</h3></td>
<td>16</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.OPEN">
<td><h3 id="InotifyWatchMask.OPEN" class="add-link hide-from-toc">OPEN</h3></td>
<td>32</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.MOVED_FROM">
<td><h3 id="InotifyWatchMask.MOVED_FROM" class="add-link hide-from-toc">MOVED_FROM</h3></td>
<td>64</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.MOVED_TO">
<td><h3 id="InotifyWatchMask.MOVED_TO" class="add-link hide-from-toc">MOVED_TO</h3></td>
<td>128</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.CREATE">
<td><h3 id="InotifyWatchMask.CREATE" class="add-link hide-from-toc">CREATE</h3></td>
<td>256</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.DELETE">
<td><h3 id="InotifyWatchMask.DELETE" class="add-link hide-from-toc">DELETE</h3></td>
<td>512</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.DELETE_SELF">
<td><h3 id="InotifyWatchMask.DELETE_SELF" class="add-link hide-from-toc">DELETE_SELF</h3></td>
<td>1024</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.MOVE_SELF">
<td><h3 id="InotifyWatchMask.MOVE_SELF" class="add-link hide-from-toc">MOVE_SELF</h3></td>
<td>2048</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.UNMOUNT">
<td><h3 id="InotifyWatchMask.UNMOUNT" class="add-link hide-from-toc">UNMOUNT</h3></td>
<td>8192</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.Q_OVERFLOW">
<td><h3 id="InotifyWatchMask.Q_OVERFLOW" class="add-link hide-from-toc">Q_OVERFLOW</h3></td>
<td>16384</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.IGNORED">
<td><h3 id="InotifyWatchMask.IGNORED" class="add-link hide-from-toc">IGNORED</h3></td>
<td>32768</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.ONLYDIR">
<td><h3 id="InotifyWatchMask.ONLYDIR" class="add-link hide-from-toc">ONLYDIR</h3></td>
<td>16777216</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.DONT_FOLLOW">
<td><h3 id="InotifyWatchMask.DONT_FOLLOW" class="add-link hide-from-toc">DONT_FOLLOW</h3></td>
<td>33554432</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.EXCL_UNLINK">
<td><h3 id="InotifyWatchMask.EXCL_UNLINK" class="add-link hide-from-toc">EXCL_UNLINK</h3></td>
<td>67108864</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.MASK_CREATE">
<td><h3 id="InotifyWatchMask.MASK_CREATE" class="add-link hide-from-toc">MASK_CREATE</h3></td>
<td>268435456</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.MASK_ADD">
<td><h3 id="InotifyWatchMask.MASK_ADD" class="add-link hide-from-toc">MASK_ADD</h3></td>
<td>536870912</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.ISDIRECTORY">
<td><h3 id="InotifyWatchMask.ISDIRECTORY" class="add-link hide-from-toc">ISDIRECTORY</h3></td>
<td>1073741824</td>
<td></td>
</tr>
<tr id="InotifyWatchMask.ONESHOT">
<td><h3 id="InotifyWatchMask.ONESHOT" class="add-link hide-from-toc">ONESHOT</h3></td>
<td>2147483648</td>
<td></td>
</tr>
</table>
### ModeType [flexible](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#ModeType}
Type: <code>uint32</code>
*Defined in [fuchsia.io/directory.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory.fidl;l=99)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
</table>
### NodeAttributeFlags [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#NodeAttributeFlags}
Type: <code>uint32</code>
*Defined in [fuchsia.io/node.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node.fidl;l=11)*
<p>The fields of 'attributes' which are used to update the Node are indicated
by the 'flags' argument.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="NodeAttributeFlags.CREATION_TIME">
<td><h3 id="NodeAttributeFlags.CREATION_TIME" class="add-link hide-from-toc">CREATION_TIME</h3></td>
<td>1</td>
<td></td>
</tr>
<tr id="NodeAttributeFlags.MODIFICATION_TIME">
<td><h3 id="NodeAttributeFlags.MODIFICATION_TIME" class="add-link hide-from-toc">MODIFICATION_TIME</h3></td>
<td>2</td>
<td></td>
</tr>
</table>
### NodeAttributesQuery [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#NodeAttributesQuery}
Type: <code>uint64</code>
*Defined in [fuchsia.io/node2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node2.fidl;l=151)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="NodeAttributesQuery.PROTOCOLS">
<td><h3 id="NodeAttributesQuery.PROTOCOLS" class="add-link hide-from-toc">PROTOCOLS</h3></td>
<td>1</td>
<td><p>Requests <a class='link' href='#NodeAttributes.protocols'>NodeAttributes.protocols</a>.</p>
</td>
</tr>
<tr id="NodeAttributesQuery.ABILITIES">
<td><h3 id="NodeAttributesQuery.ABILITIES" class="add-link hide-from-toc">ABILITIES</h3></td>
<td>2</td>
<td><p>Requests <a class='link' href='#NodeAttributes.abilities'>NodeAttributes.abilities</a>.</p>
</td>
</tr>
<tr id="NodeAttributesQuery.CONTENT_SIZE">
<td><h3 id="NodeAttributesQuery.CONTENT_SIZE" class="add-link hide-from-toc">CONTENT_SIZE</h3></td>
<td>4</td>
<td><p>Requests <a class='link' href='#NodeAttributes.content_size'>NodeAttributes.content_size</a>.</p>
</td>
</tr>
<tr id="NodeAttributesQuery.STORAGE_SIZE">
<td><h3 id="NodeAttributesQuery.STORAGE_SIZE" class="add-link hide-from-toc">STORAGE_SIZE</h3></td>
<td>8</td>
<td><p>Requests <a class='link' href='#NodeAttributes.storage_size'>NodeAttributes.storage_size</a>.</p>
</td>
</tr>
<tr id="NodeAttributesQuery.LINK_COUNT">
<td><h3 id="NodeAttributesQuery.LINK_COUNT" class="add-link hide-from-toc">LINK_COUNT</h3></td>
<td>16</td>
<td><p>Requests <a class='link' href='#NodeAttributes.link_count'>NodeAttributes.link_count</a>.</p>
</td>
</tr>
<tr id="NodeAttributesQuery.ID">
<td><h3 id="NodeAttributesQuery.ID" class="add-link hide-from-toc">ID</h3></td>
<td>32</td>
<td><p>Requests <a class='link' href='#NodeAttributes.id'>NodeAttributes.id</a>.</p>
</td>
</tr>
<tr id="NodeAttributesQuery.CREATION_TIME">
<td><h3 id="NodeAttributesQuery.CREATION_TIME" class="add-link hide-from-toc">CREATION_TIME</h3></td>
<td>64</td>
<td><p>Requests <a class='link' href='#NodeAttributes.creation_time'>NodeAttributes.creation_time</a>.</p>
</td>
</tr>
<tr id="NodeAttributesQuery.MODIFICATION_TIME">
<td><h3 id="NodeAttributesQuery.MODIFICATION_TIME" class="add-link hide-from-toc">MODIFICATION_TIME</h3></td>
<td>128</td>
<td><p>Requests <a class='link' href='#NodeAttributes.modification_time'>NodeAttributes.modification_time</a>.</p>
</td>
</tr>
</table>
### NodeFlags [flexible](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#NodeFlags}
Type: <code>uint64</code>
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=84)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="NodeFlags.GET_REPRESENTATION">
<td><h3 id="NodeFlags.GET_REPRESENTATION" class="add-link hide-from-toc">GET_REPRESENTATION</h3></td>
<td>1</td>
<td><p>Requests that an <a class='link' href='#Node.OnRepresentation'>Node.OnRepresentation</a> event be sent
as the first message on the protocol request.</p>
<p>This is a special case of
<a class='link' href='../fuchsia.unknown/'>fuchsia.unknown</a>/<a class='link' href='../fuchsia.unknown/#Queryable.Query'>Queryable.Query</a> + inherent
<code>Describe</code> methods on the specific protocols. It exists
as an optimization to avoid an additional round trip.</p>
</td>
</tr>
</table>
### NodeProtocolKinds [flexible](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#NodeProtocolKinds}
Type: <code>uint64</code>
*Defined in [fuchsia.io/node-protocols.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node-protocols.fidl;l=22)*
<p>A node may have multiple supported representations when opening, even though
it may have a fixed underlying identity.</p>
<p>Today, a file is accessed via the <a class='link' href='#File'>File</a> protocol, and sends a
<a class='link' href='#Representation.FileInfo'>Representation.FileInfo</a> when opened with <code>GET_REPRESENTATION</code>. However,
in the future we might introduce a more sophisticated <code>FileV2</code> protocol, or
a more efficient <code>SuperFastFile</code> backed by a specialized kernel object. New
clients can request the more advanced representations by specifying the
corresponding bits in <a class='link' href='#NodeProtocolKinds'>NodeProtocolKinds</a>, whereas existing clients would
continue to talk to the node via the old representation.</p>
<p><a class='link' href='#NodeProtocolKinds'>NodeProtocolKinds</a> enables forward-compatibility through a form of protocol
negotiation.</p>
<p>The elements have one-to-one correspondence with the members of
<a class='link' href='#Representation'>Representation</a>.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="NodeProtocolKinds.CONNECTOR">
<td><h3 id="NodeProtocolKinds.CONNECTOR" class="add-link hide-from-toc">CONNECTOR</h3></td>
<td>1</td>
<td><p>The connector representation of a node.</p>
<p>The connection will speak either <a class='link' href='#Node'>Node</a> or the target protocol,
depending on the flags used during opening.</p>
</td>
</tr>
<tr id="NodeProtocolKinds.DIRECTORY">
<td><h3 id="NodeProtocolKinds.DIRECTORY" class="add-link hide-from-toc">DIRECTORY</h3></td>
<td>2</td>
<td><p>The directory representation of a node.</p>
<p>The connection will speak the <a class='link' href='#Directory'>Directory</a> protocol.</p>
</td>
</tr>
<tr id="NodeProtocolKinds.FILE">
<td><h3 id="NodeProtocolKinds.FILE" class="add-link hide-from-toc">FILE</h3></td>
<td>4</td>
<td><p>The file representation of a node.</p>
<p>The connection will speak the <a class='link' href='#File'>File</a> protocol.</p>
</td>
</tr>
</table>
### OpenFlags [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#OpenFlags}
Type: <code>uint32</code>
*Defined in [fuchsia.io/directory.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory.fidl;l=9)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="OpenFlags.RIGHT_READABLE">
<td><h3 id="OpenFlags.RIGHT_READABLE" class="add-link hide-from-toc">RIGHT_READABLE</h3></td>
<td>1</td>
<td><p>Can read from target object.</p>
</td>
</tr>
<tr id="OpenFlags.RIGHT_WRITABLE">
<td><h3 id="OpenFlags.RIGHT_WRITABLE" class="add-link hide-from-toc">RIGHT_WRITABLE</h3></td>
<td>2</td>
<td><p>Can write to target object.</p>
</td>
</tr>
<tr id="OpenFlags.RIGHT_EXECUTABLE">
<td><h3 id="OpenFlags.RIGHT_EXECUTABLE" class="add-link hide-from-toc">RIGHT_EXECUTABLE</h3></td>
<td>8</td>
<td><p>Connection can map target object executable.</p>
</td>
</tr>
<tr id="OpenFlags.CREATE">
<td><h3 id="OpenFlags.CREATE" class="add-link hide-from-toc">CREATE</h3></td>
<td>65536</td>
<td><p>Create the object if it doesn't exist.</p>
</td>
</tr>
<tr id="OpenFlags.CREATE_IF_ABSENT">
<td><h3 id="OpenFlags.CREATE_IF_ABSENT" class="add-link hide-from-toc">CREATE_IF_ABSENT</h3></td>
<td>131072</td>
<td><p>(with Create) Fail if the object already exists.</p>
</td>
</tr>
<tr id="OpenFlags.TRUNCATE">
<td><h3 id="OpenFlags.TRUNCATE" class="add-link hide-from-toc">TRUNCATE</h3></td>
<td>262144</td>
<td><p>Truncate the object before usage.</p>
</td>
</tr>
<tr id="OpenFlags.DIRECTORY">
<td><h3 id="OpenFlags.DIRECTORY" class="add-link hide-from-toc">DIRECTORY</h3></td>
<td>524288</td>
<td><p>Assert that the object to be opened is a directory.
Return an error if the target object is not a directory.</p>
</td>
</tr>
<tr id="OpenFlags.APPEND">
<td><h3 id="OpenFlags.APPEND" class="add-link hide-from-toc">APPEND</h3></td>
<td>1048576</td>
<td><p>Seek to the end of the object before all writes.</p>
</td>
</tr>
<tr id="OpenFlags.NODE_REFERENCE">
<td><h3 id="OpenFlags.NODE_REFERENCE" class="add-link hide-from-toc">NODE_REFERENCE</h3></td>
<td>4194304</td>
<td><p>Open a reference to the object, not the object itself.
It is ONLY valid to pass the following flags together with <code>NODE_REFERENCE</code>:</p>
<ul>
<li><code>DIRECTORY</code></li>
<li><code>NOT_DIRECTORY</code></li>
<li><code>DESCRIBE</code>
otherwise an error is returned.
If an object is opened or cloned using this method, the resulting connection does not carry
any permission flags.
The resulting node allows a limited set of operations: <code>GetAttr</code>, <code>Clone</code>, <code>Close</code>, <code>Describe</code>,
and, if the node is a file, these extra operations: <code>GetFlags</code>, <code>SetFlags</code>.</li>
</ul>
</td>
</tr>
<tr id="OpenFlags.DESCRIBE">
<td><h3 id="OpenFlags.DESCRIBE" class="add-link hide-from-toc">DESCRIBE</h3></td>
<td>8388608</td>
<td><p>Requests that an &quot;OnOpen&quot; event is sent to the interface request.</p>
<p>The event will contain a non-null <code>NodeInfoDeprecated</code> if the open/clone is successful. This
can be used to open a protocol that does not compose fuchsia.io/Node; the event is sent as
if the protocol is fuchsia.io/Node and then the target protocol is used exclusively.</p>
</td>
</tr>
<tr id="OpenFlags.POSIX_WRITABLE">
<td><h3 id="OpenFlags.POSIX_WRITABLE" class="add-link hide-from-toc">POSIX_WRITABLE</h3></td>
<td>134217728</td>
<td><p>Specify this flag to request POSIX-compatibility with respect to write permission handling.
Currently, it affects permission handling specifically during Open:</p>
<ul>
<li>If the target path is a directory, the rights on the new connection expand to include
<code>WRITABLE</code> if and only if the current connection and all intermediate mount points
are writable.</li>
<li>Otherwise, this flag is ignored. It is an access denied error to request more rights
than those on the current connection, or any intermediate mount points.</li>
</ul>
<p>If this flag is omitted, opening always uses the requested rights, failing the operation with
access denied error if requested rights exceeds the rights attached to the current connection.</p>
<p>If the requesting connection is read-only and the requested rights are read-only, the flag
may be ignored by the server, and is not forwarded downstream. This is an implementation detail,
necessary to enforce hierarchical permissions across mount points, and should have no effect
on the expected behavior for clients.</p>
</td>
</tr>
<tr id="OpenFlags.POSIX_EXECUTABLE">
<td><h3 id="OpenFlags.POSIX_EXECUTABLE" class="add-link hide-from-toc">POSIX_EXECUTABLE</h3></td>
<td>268435456</td>
<td><p>Specify this flag to request POSIX-compatibility with respect to execute permission handling.
Currently, it affects permission handling specifically during Open:</p>
<ul>
<li>If the target path is a directory, the rights on the new connection expand to include
<code>EXECUTABLE</code> if and only if the current connection and all intermediate mount
points are executable.</li>
<li>Otherwise, this flag is ignored. It is an access denied error to request more rights
than those on the current connection, or any intermediate mount points.</li>
</ul>
<p>If this flag is omitted, opening always uses the requested rights, failing the operation with
access denied error if requested rights exceeds the rights attached to the current connection.</p>
<p>If the requesting connection is read-only and the requested rights are read-only, the flag
may be ignored by the server, and is not forwarded downstream. This is an implementation detail,
necessary to enforce hierarchical permissions across mount points, and should have no effect
on the expected behavior for clients.</p>
</td>
</tr>
<tr id="OpenFlags.NOT_DIRECTORY">
<td><h3 id="OpenFlags.NOT_DIRECTORY" class="add-link hide-from-toc">NOT_DIRECTORY</h3></td>
<td>33554432</td>
<td><p>Assert that the object to be opened is not a directory.
Return an error if the target object is a directory.</p>
</td>
</tr>
<tr id="OpenFlags.CLONE_SAME_RIGHTS">
<td><h3 id="OpenFlags.CLONE_SAME_RIGHTS" class="add-link hide-from-toc">CLONE_SAME_RIGHTS</h3></td>
<td>67108864</td>
<td><p>When used during clone, the new connection inherits the rights on the source connection,
regardless if it is a file or directory. Otherwise, clone attempts to use the requested rights.
It is invalid to pass any of the <code>RIGHT_*</code> flags together with <code>OpenFlags.CLONE_SAME_RIGHTS</code>.</p>
</td>
</tr>
<tr id="OpenFlags.BLOCK_DEVICE">
<td><h3 id="OpenFlags.BLOCK_DEVICE" class="add-link hide-from-toc">BLOCK_DEVICE</h3></td>
<td>16777216</td>
<td><p>Open the target object as a block device.</p>
</td>
</tr>
</table>
### Operations [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Operations}
Type: <code>uint64</code>
*Defined in [fuchsia.io/rights-abilities.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/rights-abilities.fidl;l=11)*
<p>The common members definition behind <a class='link' href='#Rights'>Rights</a> and <a class='link' href='#Abilities'>Abilities</a>.
Note that Directory operations are distinct from File operations, with the
exception of some common operations (e.g. <code>GET_ATTRIBUTES</code>) defined on the
underlying <a class='link' href='#Node'>Node</a>.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="Operations.CONNECT">
<td><h3 id="Operations.CONNECT" class="add-link hide-from-toc">CONNECT</h3></td>
<td>1</td>
<td><p>Connecting to a service.</p>
</td>
</tr>
<tr id="Operations.READ_BYTES">
<td><h3 id="Operations.READ_BYTES" class="add-link hide-from-toc">READ_BYTES</h3></td>
<td>2</td>
<td><p>Reading from the byte contents of a node.</p>
</td>
</tr>
<tr id="Operations.WRITE_BYTES">
<td><h3 id="Operations.WRITE_BYTES" class="add-link hide-from-toc">WRITE_BYTES</h3></td>
<td>4</td>
<td><p>Writing to the byte contents of a node.</p>
</td>
</tr>
<tr id="Operations.EXECUTE">
<td><h3 id="Operations.EXECUTE" class="add-link hide-from-toc">EXECUTE</h3></td>
<td>8</td>
<td><p>Execute the byte contents of a node.</p>
</td>
</tr>
<tr id="Operations.GET_ATTRIBUTES">
<td><h3 id="Operations.GET_ATTRIBUTES" class="add-link hide-from-toc">GET_ATTRIBUTES</h3></td>
<td>16</td>
<td><p>Reading the attributes of a node.</p>
</td>
</tr>
<tr id="Operations.UPDATE_ATTRIBUTES">
<td><h3 id="Operations.UPDATE_ATTRIBUTES" class="add-link hide-from-toc">UPDATE_ATTRIBUTES</h3></td>
<td>32</td>
<td><p>Updating the attributes of a node.</p>
</td>
</tr>
<tr id="Operations.ENUMERATE">
<td><h3 id="Operations.ENUMERATE" class="add-link hide-from-toc">ENUMERATE</h3></td>
<td>64</td>
<td><p>Reading the list of entries in a directory.</p>
</td>
</tr>
<tr id="Operations.TRAVERSE">
<td><h3 id="Operations.TRAVERSE" class="add-link hide-from-toc">TRAVERSE</h3></td>
<td>128</td>
<td><p>Opening a node from a directory.</p>
<p>When used in <code>ConnectionOptions.rights</code>, it must be specified together
with <a class='link' href='#Rights.ENUMERATE'>Rights.ENUMERATE</a>, since one can always probe the directory
contents by opening children.</p>
</td>
</tr>
<tr id="Operations.MODIFY_DIRECTORY">
<td><h3 id="Operations.MODIFY_DIRECTORY" class="add-link hide-from-toc">MODIFY_DIRECTORY</h3></td>
<td>256</td>
<td><p>Modifying the list of entries in a directory.
For example: node creation, renaming, linking, unlinking, etc.</p>
<p>When used in <code>ConnectionOptions.rights</code>, it must be specified together
with <a class='link' href='#Rights.ENUMERATE'>Rights.ENUMERATE</a>, since one can always probe the directory
contents by triggering name conflicts during node creation.</p>
</td>
</tr>
</table>
### UnlinkFlags [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#UnlinkFlags}
Type: <code>uint64</code>
*Defined in [fuchsia.io/directory2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=234)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="UnlinkFlags.MUST_BE_DIRECTORY">
<td><h3 id="UnlinkFlags.MUST_BE_DIRECTORY" class="add-link hide-from-toc">MUST_BE_DIRECTORY</h3></td>
<td>1</td>
<td><p>If set, the unlink will fail (with ZX_ERR_NOT_DIR) if the
object is not a directory.</p>
</td>
</tr>
</table>
### VmoFlags [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#VmoFlags}
Type: <code>uint32</code>
*Defined in [fuchsia.io/file2.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=169)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="VmoFlags.READ">
<td><h3 id="VmoFlags.READ" class="add-link hide-from-toc">READ</h3></td>
<td>1</td>
<td><p>Requests that the VMO be readable.</p>
</td>
</tr>
<tr id="VmoFlags.WRITE">
<td><h3 id="VmoFlags.WRITE" class="add-link hide-from-toc">WRITE</h3></td>
<td>2</td>
<td><p>Requests that the VMO be writable.</p>
</td>
</tr>
<tr id="VmoFlags.EXECUTE">
<td><h3 id="VmoFlags.EXECUTE" class="add-link hide-from-toc">EXECUTE</h3></td>
<td>4</td>
<td><p>Request that the VMO be executable.</p>
</td>
</tr>
<tr id="VmoFlags.PRIVATE_CLONE">
<td><h3 id="VmoFlags.PRIVATE_CLONE" class="add-link hide-from-toc">PRIVATE_CLONE</h3></td>
<td>65536</td>
<td><p>Require a copy-on-write clone of the underlying VMO. The request
should fail if the VMO cannot be cloned. May not be supplied
with <code>SHARED_BUFFER</code>.</p>
<p>A private clone uses at least the guarantees of the
<code>ZX_VMO_CHILD_SNAPSHOT_AT_LEAST_ON_WRITE</code> flag to
<code>zx_vmo_create_child()</code>. This means that the returned VMO will
be copy-on-write (if <code>WRITE</code> is requested) but that it may or
may not reflect subsequent content changes to the underlying
file. The returned VMO will not reflect size changes to the
file. These semantics match those of the POSIX <code>mmap()</code>
<code>MAP_PRIVATE</code> flag.</p>
<p>In some cases, clients requiring a guaranteed snapshot of the
file can use <code>SHARED_BUFFER</code> and then use
<code>zx_vmo_create_child()</code> with <code>ZX_VMO_CHILD_SNAPSHOT</code>. However,
in addition to cases where the implementation can't return a
<code>SHARED_BUFFER</code>, creating a full snapshot will fail if the VMO
is attached to the pager. Since most filesystems will use the
paging system, the full snapshot approach should only be used in
specific cases where the client is talking to a known server.</p>
</td>
</tr>
<tr id="VmoFlags.SHARED_BUFFER">
<td><h3 id="VmoFlags.SHARED_BUFFER" class="add-link hide-from-toc">SHARED_BUFFER</h3></td>
<td>131072</td>
<td><p>Require a VMO that provides direct access to the contents of the
file's underlying VMO. The request should fail if such a VMO
cannot be provided. May not be supplied with <code>PRIVATE_CLONE</code>.</p>
<p>The returned VMO may not be resizable even when <code>WRITE</code> access is
requested. In this case, <a class='link' href='#File.Resize'>File.Resize</a> should be used to resize
the file.</p>
</td>
</tr>
</table>
### WatchMask [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#WatchMask}
Type: <code>uint32</code>
*Defined in [fuchsia.io/directory.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory.fidl;l=163)*
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="WatchMask.DELETED">
<td><h3 id="WatchMask.DELETED" class="add-link hide-from-toc">DELETED</h3></td>
<td>1</td>
<td><p>Used by <code>Directory.Watch</code>. Requests transmission of <code>WatchEvent.DELETED</code>.</p>
</td>
</tr>
<tr id="WatchMask.ADDED">
<td><h3 id="WatchMask.ADDED" class="add-link hide-from-toc">ADDED</h3></td>
<td>2</td>
<td><p>Used by <code>Directory.Watch</code>. Requests transmission of <code>WatchEvent.ADDED</code>.</p>
</td>
</tr>
<tr id="WatchMask.REMOVED">
<td><h3 id="WatchMask.REMOVED" class="add-link hide-from-toc">REMOVED</h3></td>
<td>4</td>
<td><p>Used by <code>Directory.Watch</code>. Requests transmission of <code>WatchEvent.REMOVED</code>.</p>
</td>
</tr>
<tr id="WatchMask.EXISTING">
<td><h3 id="WatchMask.EXISTING" class="add-link hide-from-toc">EXISTING</h3></td>
<td>8</td>
<td><p>Used by <code>Directory.Watch</code>. Requests transmission of <code>WatchEvent.EXISTING</code>.</p>
</td>
</tr>
<tr id="WatchMask.IDLE">
<td><h3 id="WatchMask.IDLE" class="add-link hide-from-toc">IDLE</h3></td>
<td>16</td>
<td><p>Used by <code>Directory.Watch</code>. Requests transmission of <code>WatchEvent.IDLE</code>.</p>
</td>
</tr>
</table>
## **CONSTANTS**
<table>
<tr><th>Name</th><th>Value</th><th>Type</th><th>Description</th></tr>
<tr id="CLOSE_ALL">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/inotify.fidl;l=46">CLOSE_ALL</a></td>
<td></td>
</tr>
<tr id="DIRECTORY_PROTOCOL_NAME">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory2.fidl;l=46">DIRECTORY_PROTOCOL_NAME</a></td>
<td><code>fuchsia.io/Directory</code></td>
<td><code>String</code></td>
<td></td>
</tr>
<tr id="FILE_PROTOCOL_NAME">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=48">FILE_PROTOCOL_NAME</a></td>
<td><code>fuchsia.io/File</code></td>
<td><code>String</code></td>
<td></td>
</tr>
<tr id="INO_UNKNOWN">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory.fidl;l=127">INO_UNKNOWN</a></td>
<td>
<code>18446744073709551615</code>
</td>
<td><code>uint64</code></td>
<td><p>Nodes which do not have ino values should return this value
from Readdir and GetAttr.</p>
</td>
</tr>
<tr id="MAX_BUF">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory.fidl;l=103">MAX_BUF</a></td>
<td>
<code>8192</code>
</td>
<td><code>uint64</code></td>
<td><p>The maximal buffer size which can be transmitted for buffered operations.
This capacity is currently set somewhat arbitrarily.</p>
</td>
</tr>
<tr id="MAX_FILENAME">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory.fidl;l=108">MAX_FILENAME</a></td>
<td>
<code>255</code>
</td>
<td><code>uint64</code></td>
<td><p>The maximum length, in bytes, of a single filesystem component.</p>
</td>
</tr>
<tr id="MAX_FS_NAME_BUFFER">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node.fidl;l=54">MAX_FS_NAME_BUFFER</a></td>
<td>
<code>32</code>
</td>
<td><code>uint64</code></td>
<td></td>
</tr>
<tr id="MAX_NAME_LENGTH">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/io.fidl;l=25">MAX_NAME_LENGTH</a></td>
<td>
<code>255</code>
</td>
<td><code>uint64</code></td>
<td><p>The maximum length, in bytes, of a single filesystem component.</p>
</td>
</tr>
<tr id="MAX_PATH_LENGTH">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/io.fidl;l=46">MAX_PATH_LENGTH</a></td>
<td>
<code>4095</code>
</td>
<td><code>uint64</code></td>
<td><p>The maximum length, in bytes, of a filesystem path.</p>
</td>
</tr>
<tr id="MAX_TRANSFER_SIZE">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=12">MAX_TRANSFER_SIZE</a></td>
<td>
<code>8192</code>
</td>
<td><code>uint64</code></td>
<td><p>The maximum I/O size that is allowed for read/write operations using
byte vectors.</p>
</td>
</tr>
<tr id="MODE_PROTECTION_MASK">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node.fidl;l=20">MODE_PROTECTION_MASK</a></td>
<td>
<code>4095</code>
</td>
<td><code>uint32</code></td>
<td><p>Bits reserved for posix protections. Native fuchsia filesystems
are not required to set bits contained within <code>MODE_PROTECTION_MASK</code>,
but filesystems that wish to do so may refer to sys/stat.h for their
definitions.</p>
</td>
</tr>
<tr id="MODE_TYPE_BLOCK_DEVICE">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node.fidl;l=25">MODE_TYPE_BLOCK_DEVICE</a></td>
<td>
<code>24576</code>
</td>
<td><code>uint32</code></td>
<td></td>
</tr>
<tr id="MODE_TYPE_DIRECTORY">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node.fidl;l=23">MODE_TYPE_DIRECTORY</a></td>
<td>
<code>16384</code>
</td>
<td><code>uint32</code></td>
<td></td>
</tr>
<tr id="MODE_TYPE_FILE">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node.fidl;l=27">MODE_TYPE_FILE</a></td>
<td>
<code>32768</code>
</td>
<td><code>uint32</code></td>
<td></td>
</tr>
<tr id="MODE_TYPE_MASK">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node.fidl;l=34">MODE_TYPE_MASK</a></td>
<td>
<code>1044480</code>
</td>
<td><code>uint32</code></td>
<td><p>Bits indicating node type. The canonical mechanism to check
for a node type is to take 'mode', bitwise AND it with the
<code>MODE_TYPE_MASK</code>, and check exact equality against a mode type.</p>
</td>
</tr>
<tr id="MODE_TYPE_SERVICE">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node.fidl;l=29">MODE_TYPE_SERVICE</a></td>
<td>
<code>65536</code>
</td>
<td><code>uint32</code></td>
<td></td>
</tr>
<tr id="MOVE">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/inotify.fidl;l=47">MOVE</a></td>
<td></td>
</tr>
<tr id="NODE_PROTOCOL_NAME">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/node2.fidl;l=29">NODE_PROTOCOL_NAME</a></td>
<td><code>fuchsia.io/Node</code></td>
<td><code>String</code></td>
<td></td>
</tr>
<tr id="OPEN_FLAGS_ALLOWED_WITH_NODE_REFERENCE">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory.fidl;l=96">OPEN_FLAGS_ALLOWED_WITH_NODE_REFERENCE</a></td>
<td><p>Flags used when opening a node reference must fall within this mask.</p>
</td>
</tr>
<tr id="OPEN_RIGHTS">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/directory.fidl;l=92">OPEN_RIGHTS</a></td>
<td><p>All known rights.</p>
</td>
</tr>
<tr id="RW_STAR_DIR">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/rights-abilities.fidl;l=54">RW_STAR_DIR</a></td>
<td><p>Alias for directory permission alias rw*</p>
</td>
</tr>
<tr id="RX_STAR_DIR">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/rights-abilities.fidl;l=58">RX_STAR_DIR</a></td>
<td><p>Alias for directory permission alias rx*</p>
</td>
</tr>
<tr id="R_STAR_DIR">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/rights-abilities.fidl;l=50">R_STAR_DIR</a></td>
<td><p>Alias for directory permission alias r*</p>
</td>
</tr>
<tr id="W_STAR_DIR">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/rights-abilities.fidl;l=62">W_STAR_DIR</a></td>
<td><p>Alias for directory permission alias w*</p>
</td>
</tr>
<tr id="X_STAR_DIR">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/rights-abilities.fidl;l=66">X_STAR_DIR</a></td>
<td><p>Alias for directory permission alias x*</p>
</td>
</tr>
</table>
## **ALIASES**
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="Abilities">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/rights-abilities.fidl;l=83">Abilities</a></td>
<td>
<code>fuchsia.io/Operations</code></td>
<td><p>Abilities are properties intrinsic to a node. They specify which operations
are supported by it.</p>
<p>Invoking an operation without corresponding support in the node results in a
<code>ZX_ERR_NOT_SUPPORTED</code> error.
Note that if both the access denied and the not supported error conditions
apply, the access denied case takes precedence.</p>
</td>
</tr>
<tr id="Id">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/io.fidl;l=68">Id</a></td>
<td>
<code>uint64</code></td>
<td><p>The type to identify a node, if the implementation supports some notion of
unique node ID.</p>
<h2>Uniqueness Guarantees</h2>
<p>A client is usually presented with a directory tree that is the result
of composing together multiple backing implementation instances. An ID
would be unique within the corresponding instance only.
Their boundaries are rather implicit on Fuchsia, as a result of
transparently-forwarding directory proxies. It could be common for a client
to observe identical <code>Id</code>s when traversing a directory tree, when it
encounters nodes from different backing instances. Therefore, the ID is best
used for debugging and informational purposes.</p>
<p>The <a class='link' href='../fuchsia.fs/'>fuchsia.fs</a>/<a class='link' href='../fuchsia.fs/#FilesystemInfo.fs_id'>FilesystemInfo.fs_id</a> field may be used to disambiguate
IDs from different backing instances.</p>
</td>
</tr>
<tr id="Name">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/io.fidl;l=22">Name</a></td>
<td>
<code>string</code>[<code><a class='link' href='#MAX_NAME_LENGTH'>MAX_NAME_LENGTH</a></code>]</td>
<td><p>The type for the name of a node, i.e. a single path component.
E.g. <code>foo</code></p>
<h2>Invariants</h2>
<p>A valid node name must meet the following criteria:</p>
<ul>
<li>It cannot be longer than <a class='link' href='#MAX_NAME_LENGTH'>MAX_NAME_LENGTH</a>.</li>
<li>It cannot be empty.</li>
<li>It cannot be &quot;..&quot; (dot-dot).</li>
<li>It cannot be &quot;.&quot; (single dot).</li>
<li>It cannot contain &quot;/&quot;.</li>
<li>It cannot contain embedded NUL.</li>
</ul>
</td>
</tr>
<tr id="Path">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/io.fidl;l=43">Path</a></td>
<td>
<code>string</code>[<code><a class='link' href='#MAX_PATH_LENGTH'>MAX_PATH_LENGTH</a></code>]</td>
<td><p>A path is a string of one or more components, separated by &quot;/&quot;.
E.g. <code>foo/bar/baz</code></p>
<h2>Invariants</h2>
<p>A valid path must meet the following criteria:</p>
<ul>
<li>It cannot be empty.</li>
<li>It cannot be longer than <a class='link' href='#MAX_PATH_LENGTH'>MAX_PATH_LENGTH</a>.</li>
<li>It cannot have a leading &quot;/&quot;.</li>
<li>It cannot have a trailing &quot;/&quot;.</li>
<li>It must be exactly &quot;.&quot; OR each of its components must be a valid <a class='link' href='#Name'>Name</a>.</li>
</ul>
<p>Paths should be transformed into their canonical forms at client side.
For example, a client should convert <code>&quot;foo/bar/.././baz/&quot;</code> to <code>&quot;foo/baz&quot;</code>
before using it as a path.</p>
</td>
</tr>
<tr id="Rights">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/rights-abilities.fidl;l=74">Rights</a></td>
<td>
<code>fuchsia.io/Operations</code></td>
<td><p>Rights are properties specific to a connection. They limit which operations
are allowed on a connection.</p>
<p>Invoking an operation without the corresponding right results in a
<code>ZX_ERR_ACCESS_DENIED</code> error.</p>
</td>
</tr>
<tr id="Token">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/io.fidl;l=50">Token</a></td>
<td>
<code>zx/handle</code></td>
<td><p>The type to identify a connection to a node.
It represents a capability: a reference to a node with associated rights.</p>
</td>
</tr>
<tr id="Transfer">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.io/file2.fidl;l=15">Transfer</a></td>
<td>
<code>vector</code>[<code><a class='link' href='#MAX_TRANSFER_SIZE'>MAX_TRANSFER_SIZE</a></code>]</td>
<td><p>The byte vector type used for read/write operations.</p>
</td>
</tr>
</table>