PROTOCOLS
AdvisoryLocking
Defined in fuchsia.io/locking.fidl
Advisory locking protocol.
This protocol is intended to be composed into the |File| protocol to provide support for advisory locking.
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.
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.
AdvisoryLock
Acquires an advisory lock on the underlying file.
The lock lasts until either this connection is closed or this method is called with |AdvisoryLockType.UNLOCK| to release the lock explicitly.
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.
This method requires the following rights:
- Rights.READ_BYTES if
request.typeis AdvisoryLockType.READ. - Rights.WRITE_BYTES if
request.typeis AdvisoryLockType.WRITE.
Errors
ZX_ERR_BAD_STATEThe specified type of lock cannot be acquired. For example, another connection might hold a conflicting lock type.ZX_ERR_NOT_SUPPORTEDThis file does not support advisory locking.ZX_ERR_ACCESS_DENIEDThis connection does not have sufficient rights to acquire the given type of lock.
Request
| Name | Type |
|---|---|
request |
AdvisoryLockRequest
|
Response
| Name | Type |
|---|---|
payload |
AdvisoryLocking_AdvisoryLock_Result
|
Directory
Defined in fuchsia.io/directory.fidl
Directory defines a node which is capable of containing other Objects.
AdvisoryLock
Acquires an advisory lock on the underlying file.
The lock lasts until either this connection is closed or this method is called with |AdvisoryLockType.UNLOCK| to release the lock explicitly.
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.
This method requires the following rights:
- Rights.READ_BYTES if
request.typeis AdvisoryLockType.READ. - Rights.WRITE_BYTES if
request.typeis AdvisoryLockType.WRITE.
Errors
ZX_ERR_BAD_STATEThe specified type of lock cannot be acquired. For example, another connection might hold a conflicting lock type.ZX_ERR_NOT_SUPPORTEDThis file does not support advisory locking.ZX_ERR_ACCESS_DENIEDThis connection does not have sufficient rights to acquire the given type of lock.
Request
| Name | Type |
|---|---|
request |
AdvisoryLockRequest
|
Response
| Name | Type |
|---|---|
payload |
AdvisoryLocking_AdvisoryLock_Result
|
Clone
Request
| Name | Type |
|---|---|
request |
server_end:fuchsia.unknown/Cloneable
|
Close
Terminates the connection.
After calling Close, the client must not send any other requests.
Servers, after sending the status response, should close the connection regardless of status and without sending an epitaph.
Closing the client end of the channel should be semantically equivalent
to calling Close without knowing when the close has completed or its
status.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.unknown/Closeable_Close_Result
|
CreateSymlink
Creates a symbolic link.
name is the name to be given to the created symbolic link.
target is the target of the symbolic link, which has no meaning on the server. The server
will perform no validation of target except for a server chosen maximum length.
connection is an optional server end of a channel that will speak the Symlink protocol
on the successfully created node.
-
error
ZX_ERR_ALREADY_EXISTSifnamealready exists. -
error
ZX_ERR_BAD_PATHiftargetexceeds the server length limit for symbolic links. -
error
ZX_ERR_INVALID_ARGSifnameis not a valid Name. -
error
ZX_ERR_NOT_SUPPORTEDif creating symbolic links is not supported by the server.
Request
| Name | Type |
|---|---|
name |
Name
|
target |
SymlinkTarget
|
connection |
server_end:Symlink?
|
Response
| Name | Type |
|---|---|
payload |
Directory_CreateSymlink_Result
|
DeprecatedClone
DEPRECATED - Use fuchsia.unknown/Cloneable.Clone instead.
Request
| Name | Type |
|---|---|
flags |
OpenFlags
|
object |
server_end:Node
|
DeprecatedGetAttr
DEPRECATED - Use Node.GetAttributes instead.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
s |
zx/Status
|
attributes |
NodeAttributes
|
DeprecatedGetFlags
[DEPRECATED - Use new GetFlags method instead.]
Request
<EMPTY>
Response
| Name | Type |
|---|---|
s |
zx/Status
|
flags |
OpenFlags
|
DeprecatedOpen
DEPRECATED - Use fuchsia.io/Directory.Open instead.
Request
| Name | Type |
|---|---|
flags |
OpenFlags
|
mode |
ModeType
|
path |
Path
|
object |
server_end:Node
|
DeprecatedSetAttr
DEPRECATED - Use Node.UpdateAttributes instead.
Request
| Name | Type |
|---|---|
flags |
NodeAttributeFlags
|
attributes |
NodeAttributes
|
Response
| Name | Type |
|---|---|
s |
zx/Status
|
DeprecatedSetFlags
[DEPRECATED - Use new SetFlags method instead.]
Request
| Name | Type |
|---|---|
flags |
OpenFlags
|
Response
| Name | Type |
|---|---|
s |
zx/Status
|
GetAttributes
Acquires information about the node.
The attributes of a node should be stable, independent of the specific protocol used to access it.
If a particular attribute is not applicable or not supported, filesystems should leave the corresponding field absent.
querya bit-mask specifying which attributes to fetch. The server should not return more than necessary.
attributesthe returned attributes.
This method requires the Rights.GET_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
query |
NodeAttributesQuery
|
Response
| Name | Type |
|---|---|
payload |
Node_GetAttributes_Result
|
GetExtendedAttribute
Get the value associated with the given attribute name for this node.
Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No particular structure is imposed on them.
This method requires the Rights.GET_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
name |
ExtendedAttributeName
|
Response
| Name | Type |
|---|---|
payload |
Node_GetExtendedAttribute_Result
|
GetFlags
Queries the flags that apply to this node after it has been opened/created. This method does not require any rights.
Note that the final set of flags that apply to the connection may differ from those
specified with the fuchsia.io/Directory.Open request used to create it:
Flags.PERM_INHERIT_*: Only applies when determining connection rights.Flags.PROTOCOL_*: Only the protocol of the connection will be present.Flags.FLAG_*: Only applies when opening the resource, not part of the connection.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Node_GetFlags_Result
|
GetToken
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.
This method requires following rights: OpenFlags.RIGHT_WRITABLE, otherwise returns
ZX_ERR_BAD_HANDLE.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
s |
zx/Status
|
token |
handle<handle>?
|
Link
Creates a link to an object named src by the name dst, within a directory represented by token.
src must be a resolved object name. Including "/" in the string will
return ZX_ERR_INVALID_ARGS.
dst must be a resolved object name. Including "/" in the string will
return ZX_ERR_INVALID_ARGS.
This method requires following rights: OpenFlags.RIGHT_WRITABLE and
OpenFlags.RIGHT_READABLE, otherwise returns ZX_ERR_BAD_HANDLE.
This will be atomic with respect to renaming or unlinking the source concurrently e.g. if there are two actors operating concurrently, and one actor performs a rename that affects the source within this directory, and the other does a link, each will appear to occur atomically in an unspecified order.
Request
| Name | Type |
|---|---|
src |
Name
|
dst_parent_token |
handle<handle>
|
dst |
Name
|
Response
| Name | Type |
|---|---|
s |
zx/Status
|
ListExtendedAttributes
Creates an iterator over all the extended attribute names associated with this node. If an error occurs it is returned as an epitaph on the iterator request channel, and then the channel is closed.
GetExtendedAttributes can be used with any of these names to retrieve the associated value.
This method requires the Rights.GET_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
iterator |
server_end:ExtendedAttributeIterator
|
OnOpen
An event produced eagerly by a FIDL server if requested by OpenFlags.DESCRIBE.
Indicates the success or failure of the open operation, and optionally describes the
object. If the status is ZX_OK, info contains descriptive information about the object
(the same as would be returned by Describe).
Response
| Name | Type |
|---|---|
s |
zx/Status
|
info |
NodeInfoDeprecated?
|
OnRepresentation
An event produced eagerly by the server if requested by Flags.FLAG_SEND_REPRESENTATION. This event will be sent as the first message from the server, and is sent exactly once.
The active variant corresponds to the negotiated protocol for the target node (i.e. the protocol which this channel now speaks). Additionally, auxiliary handles and requested attributes are also returned in the event.
Response
| Name | Type |
|---|---|
payload |
Representation
|
Open
Open (or create) a node relative to this directory. Any errors are communicated via an
epitaph sent on the object channel.
Errors:
ZX_ERR_BAD_PATHifpathis invalid- See Flags for other errors which may be communicated based on
flags
Request
| Name | Type |
|---|---|
path |
Path
|
flags |
Flags
|
options |
Options
|
object |
handle<channel>
|
Query
Request
<EMPTY>
Response
| Name | Type |
|---|---|
protocol |
vector<uint8>
|
QueryFilesystem
Query the filesystem for filesystem-specific information.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
s |
zx/Status
|
info |
FilesystemInfo?
|
ReadDirents
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, dirents will be empty.
These dirents are of the form:
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];
}
This method does not require any rights, since one could always probe for directory contents by triggering name conflicts during file creation.
Request
| Name | Type |
|---|---|
max_bytes |
uint64
|
Response
| Name | Type |
|---|---|
s |
zx/Status
|
dirents |
vector<uint8>:8192
|
RemoveExtendedAttribute
Remove the specified extended attribute.
If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
This method requires the Rights.UPDATE_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
name |
ExtendedAttributeName
|
Response
| Name | Type |
|---|---|
payload |
Node_RemoveExtendedAttribute_Result
|
Rename
Renames a node named src to the name dst, in a directory represented
by dst_parent_token.
src and dst must be valid node names.
See Name for what constitutes a valid name.
This method requires the following rights on both the current connection, and the connection
identified by dst_parent_token:
The following requirements are necessary to avoid rights escalations.
If the source and destination directory differ, the source directory must also have the maximal set of abilities supported for files, which would typically be Rights.READ_BYTES, Rights.WRITE_BYTES, Rights.GET_ATTRIBUTES and Rights.UPDATE_ATTRIBUTES. Some filesystems might also support the Rights.EXECUTE right.
If src refers to a directory, and differs from the destination directory, then the source
directory must have also have the Rights.CONNECT and Rights.TRAVERSE rights.
- error
ZX_ERR_INVALID_ARGSifsrcordstis invalid. - error
ZX_ERR_ACCESS_DENIEDfor insufficient rights.
Request
| Name | Type |
|---|---|
src |
Name
|
dst_parent_token |
Token
|
dst |
Name
|
Response
| Name | Type |
|---|---|
payload |
Directory_Rename_Result
|
Rewind
Resets the directory seek offset.
This method does not require any rights, similar to ReadDirents.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
s |
zx/Status
|
SetExtendedAttribute
Set the value for the given attribute name to value for this node.
The attribute name may exist, in which case the attribute is updated. If the attribute doesn't exist, it is created. The name should have no null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
This method requires the Rights.UPDATE_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
name |
ExtendedAttributeName
|
value |
ExtendedAttributeValue
|
mode |
SetExtendedAttributeMode
|
Response
| Name | Type |
|---|---|
payload |
Node_SetExtendedAttribute_Result
|
SetFlags
Sets the flags that apply to this node after it has been opened. This method does not require any rights.
Only Flags.FILE_APPEND is currently supported. Calling this method without any flags will
clear append mode.
Errors:
ZX_ERR_NOT_SUPPORTED: The object does not support this feature or the specified flags.ZX_ERR_INVALID_ARGS:flagsother thanFlags.FILE_APPENDwere specified.
Request
| Name | Type |
|---|---|
flags |
Flags
|
Response
| Name | Type |
|---|---|
payload |
Node_SetFlags_Result
|
Sync
Synchronizes updates to the node to the underlying media, if it exists.
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 Sync to ensure ordering
between operations.
This method does not require any rights.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Node_Sync_Result
|
Unlink
Removes a child node from the this directory's list of entries.
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.
- error
ZX_ERR_ACCESS_DENIEDif the connection does not have Rights.WRITE_BYTES. - error
ZX_ERR_NOT_SUPPORTEDif the underlying filesystem does not support writing. - error
ZX_ERR_BAD_PATHifnameis invalid. - error
ZX_ERR_NOT_EMPTYifnamerefers to a non-empty directory. - error
ZX_ERR_UNAVAILABLEifnamerefers to a mount point, containing a remote channel. - error
ZX_ERR_NOT_DIRif the options requested a directory but something other than a directory was found.
Other errors may be returned for filesystem-specific reasons.
This method requires the following rights:
Request
| Name | Type |
|---|---|
name |
Name
|
options |
UnlinkOptions
|
Response
| Name | Type |
|---|---|
payload |
Directory_Unlink_Result
|
UpdateAttributes
Updates information about the node.
attributesthe presence of a table field inattributesindicates the intent to update the corresponding attribute.
Returns ZX_ERR_NOT_SUPPORTED if the node does not support any of the specified attributes.
This method requires the Rights.UPDATE_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
payload |
MutableNodeAttributes
|
Response
| Name | Type |
|---|---|
payload |
Node_UpdateAttributes_Result
|
Watch
Watches a directory, receiving events of added messages on the watcher request channel.
Options must be zero; it is reserved.
This method does not require any rights, similar to ReadDirents.
Request
| Name | Type |
|---|---|
mask |
WatchMask
|
options |
uint32
|
watcher |
server_end:DirectoryWatcher
|
Response
| Name | Type |
|---|---|
s |
zx/Status
|
DirectoryWatcher
Defined in fuchsia.io/directory.fidl
DirectoryWatcher transmits messages from a filesystem server
about events happening in the filesystem. Clients can register
new watchers using the Directory.Watch method, where they can
filter which events they want to receive notifications for.
The DirectoryWatcher will send messages of the form:
struct {
uint8 event;
uint8 len;
char name[];
};
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
IDLE event).
ExtendedAttributeIterator
Defined in fuchsia.io/node.fidl
GetNext
Get the next chunk of extended attribute names. If this is the last chunk, last will be true, and the channel will be closed after the call.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
ExtendedAttributeIterator_GetNext_Result
|
File
Defined in fuchsia.io/file.fidl
A Node which contains a sequence of bytes of definite length.
NOTE: cloned connections do not share their seek offset with their source connection.
AdvisoryLock
Acquires an advisory lock on the underlying file.
The lock lasts until either this connection is closed or this method is called with |AdvisoryLockType.UNLOCK| to release the lock explicitly.
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.
This method requires the following rights:
- Rights.READ_BYTES if
request.typeis AdvisoryLockType.READ. - Rights.WRITE_BYTES if
request.typeis AdvisoryLockType.WRITE.
Errors
ZX_ERR_BAD_STATEThe specified type of lock cannot be acquired. For example, another connection might hold a conflicting lock type.ZX_ERR_NOT_SUPPORTEDThis file does not support advisory locking.ZX_ERR_ACCESS_DENIEDThis connection does not have sufficient rights to acquire the given type of lock.
Request
| Name | Type |
|---|---|
request |
AdvisoryLockRequest
|
Response
| Name | Type |
|---|---|
payload |
AdvisoryLocking_AdvisoryLock_Result
|
Allocate
Pre-allocate on-disk space for this file.
Request
| Name | Type |
|---|---|
offset |
uint64
|
length |
uint64
|
mode |
AllocateMode
|
Response
| Name | Type |
|---|---|
payload |
File_Allocate_Result
|
Clone
Request
| Name | Type |
|---|---|
request |
server_end:fuchsia.unknown/Cloneable
|
Close
Terminates the connection.
After calling Close, the client must not send any other requests.
Servers, after sending the status response, should close the connection regardless of status and without sending an epitaph.
Closing the client end of the channel should be semantically equivalent
to calling Close without knowing when the close has completed or its
status.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.unknown/Closeable_Close_Result
|
DeprecatedClone
DEPRECATED - Use fuchsia.unknown/Cloneable.Clone instead.
Request
| Name | Type |
|---|---|
flags |
OpenFlags
|
object |
server_end:Node
|
DeprecatedGetAttr
DEPRECATED - Use Node.GetAttributes instead.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
s |
zx/Status
|
attributes |
NodeAttributes
|
DeprecatedGetFlags
[DEPRECATED - Use new GetFlags method instead.]
Request
<EMPTY>
Response
| Name | Type |
|---|---|
s |
zx/Status
|
flags |
OpenFlags
|
DeprecatedSetAttr
DEPRECATED - Use Node.UpdateAttributes instead.
Request
| Name | Type |
|---|---|
flags |
NodeAttributeFlags
|
attributes |
NodeAttributes
|
Response
| Name | Type |
|---|---|
s |
zx/Status
|
DeprecatedSetFlags
[DEPRECATED - Use new SetFlags method instead.]
Request
| Name | Type |
|---|---|
flags |
OpenFlags
|
Response
| Name | Type |
|---|---|
s |
zx/Status
|
Describe
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
FileInfo
|
EnableVerity
Enables verification for the file (permanently) which involves computing a merkle tree for the file. Forces a flush prior to building the merkle tree to ensure cached data is captured. Future reads will be verified against the computed merkle tree and writes will be rejected. This method can take some time to complete as it depends on the size of the file. This method can be aborted by closing the connection that this method was issued on.
This method requires the Rights.UPDATE_ATTRIBUTES right.
Returns ZX_ERR_NOT_SUPPORTED if the filesystem does not support verity.
Returns ZX_ERR_ALREADY_EXISTS if the file was already fsverity-enabled.
Also returns any error that might arise from reading the file, or from flushing the file,
such as ZX_ERR_IO.
Request
| Name | Type |
|---|---|
options |
VerificationOptions
|
Response
| Name | Type |
|---|---|
payload |
File_EnableVerity_Result
|
GetAttributes
Acquires information about the node.
The attributes of a node should be stable, independent of the specific protocol used to access it.
If a particular attribute is not applicable or not supported, filesystems should leave the corresponding field absent.
querya bit-mask specifying which attributes to fetch. The server should not return more than necessary.
attributesthe returned attributes.
This method requires the Rights.GET_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
query |
NodeAttributesQuery
|
Response
| Name | Type |
|---|---|
payload |
Node_GetAttributes_Result
|
GetBackingMemory
Acquires a zx.Handle:VMO representing this file, if there is one, with the requested access rights.
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.
If a client specifies neither PRIVATE_CLONE nor SHARED_BUFFER, the
implementation is free to choose the semantics of the returned VMO.
- request
flagsa VmoFlags indicating the desired mode of access.
- response
vmothe requested zx.Handle:VMO.
- error a zx.Status value indicating the failure.
This method requires the following rights:
- Rights.READ_BYTES if
flagsincludes VmoFlags.READ. - Rights.WRITE_BYTES if
flagsincludes VmoFlags.WRITE. - Rights.EXECUTE if
flagsincludes VmoFlags.EXECUTE.
Request
| Name | Type |
|---|---|
flags |
VmoFlags
|
Response
| Name | Type |
|---|---|
payload |
File_GetBackingMemory_Result
|
GetExtendedAttribute
Get the value associated with the given attribute name for this node.
Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No particular structure is imposed on them.
This method requires the Rights.GET_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
name |
ExtendedAttributeName
|
Response
| Name | Type |
|---|---|
payload |
Node_GetExtendedAttribute_Result
|
GetFlags
Queries the flags that apply to this node after it has been opened/created. This method does not require any rights.
Note that the final set of flags that apply to the connection may differ from those
specified with the fuchsia.io/Directory.Open request used to create it:
Flags.PERM_INHERIT_*: Only applies when determining connection rights.Flags.PROTOCOL_*: Only the protocol of the connection will be present.Flags.FLAG_*: Only applies when opening the resource, not part of the connection.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Node_GetFlags_Result
|
LinkInto
Creates a link to this this object with name dst in the directory represented by
dst_parent_token.
dst must be a resolved object name. Including "/" in the string will return
ZX_ERR_INVALID_ARGS.
This method requires the maximal set of rights supported by the filesystem for this object.
For files this would typically be Rights.READ_BYTES, Rights.WRITE_BYTES,
Rights.GET_ATTRIBUTES and Rights.UPDATE_ATTRIBUTES. Some filesystems might also
support the Rights.EXECUTE right. Insufficient rights will result in
ZX_ERR_ACCESS_DENIED.
If this object has no links and is NOT an unnamed temporary object (objects opened with
Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY), it will fail with ZX_ERR_NOT_FOUND.
For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
the object will be permanently linked to the filesystem. Requires that the unnamed temporary
object is linkable, if not, it will fail with ZX_ERR_NOT_FOUND.
This method does not have the same atomicity properties has the Directory::Link method,
which means that calling Open then LinkInto is not equivalent to Directory::Link
because LinkInto will not prevent the source from being renamed or unlinked.
Request
| Name | Type |
|---|---|
dst_parent_token |
Token
|
dst |
Name
|
Response
| Name | Type |
|---|---|
payload |
Linkable_LinkInto_Result
|
ListExtendedAttributes
Creates an iterator over all the extended attribute names associated with this node. If an error occurs it is returned as an epitaph on the iterator request channel, and then the channel is closed.
GetExtendedAttributes can be used with any of these names to retrieve the associated value.
This method requires the Rights.GET_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
iterator |
server_end:ExtendedAttributeIterator
|
OnOpen
An event produced eagerly by a FIDL server if requested by OpenFlags.DESCRIBE.
Indicates the success or failure of the open operation, and optionally describes the
object. If the status is ZX_OK, info contains descriptive information about the object
(the same as would be returned by Describe).
Response
| Name | Type |
|---|---|
s |
zx/Status
|
info |
NodeInfoDeprecated?
|
OnRepresentation
An event produced eagerly by the server if requested by Flags.FLAG_SEND_REPRESENTATION. This event will be sent as the first message from the server, and is sent exactly once.
The active variant corresponds to the negotiated protocol for the target node (i.e. the protocol which this channel now speaks). Additionally, auxiliary handles and requested attributes are also returned in the event.
Response
| Name | Type |
|---|---|
payload |
Representation
|
Query
Request
<EMPTY>
Response
| Name | Type |
|---|---|
protocol |
vector<uint8>
|
QueryFilesystem
Query the filesystem for filesystem-specific information.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
s |
zx/Status
|
info |
FilesystemInfo?
|
Read
Reads up to 'count' bytes at the seek offset. The seek offset is moved forward by the number of bytes read.
Invariants
- The returned
data.lengthwill never be greater thancount. - If
data.lengthis less thancount, it means that the seek offset has reached the end of file as part of this operation. - If
data.lengthis zero whilecountis not, it means that the seek offset is already at or beyond the end of file, and no data could be read. - If
countis zero, the server should perform all the checks ensuring read access without actually read anything, and return an emptydatavector.
This method requires the Rights.READ_BYTES right.
Returns ZX_ERR_OUT_OF_RANGE if count is greater than MAX_TRANSFER_SIZE.
Request
| Name | Type |
|---|---|
count |
uint64
|
Response
| Name | Type |
|---|---|
payload |
Readable_Read_Result
|
ReadAt
Reads up to 'count' bytes at the provided offset. Does not affect the seek offset.
Invariants
- The returned
data.lengthwill never be greater thancount. - If
data.lengthis less thancount, it means thatReadAthas hit the end of file as part of this operation. - If
data.lengthis zero whilecountis not, it means thatoffsetis at or past the end of file, and no data can be read. - If
countis zero, the server should perform all the checks ensuring read access without actually reading anything, and return an emptydatavector.
This method requires the Rights.READ_BYTES right.
Returns ZX_ERR_OUT_OF_RANGE if count is greater than MAX_TRANSFER_SIZE.
Request
| Name | Type |
|---|---|
count |
uint64
|
offset |
uint64
|
Response
| Name | Type |
|---|---|
payload |
File_ReadAt_Result
|
RemoveExtendedAttribute
Remove the specified extended attribute.
If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
This method requires the Rights.UPDATE_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
name |
ExtendedAttributeName
|
Response
| Name | Type |
|---|---|
payload |
Node_RemoveExtendedAttribute_Result
|
Resize
Shrinks or grows the file size to 'length' bytes.
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.
This method requires the Rights.WRITE_BYTES right.
Request
| Name | Type |
|---|---|
length |
uint64
|
Response
| Name | Type |
|---|---|
payload |
File_Resize_Result
|
Seek
Moves the offset at which the next invocation of Read or Write will occur. The seek offset is specific to each file connection.
- request
originthe reference point whereoffsetwill be based on. - request
offsetthe number of bytes to seek.
- response
offset_from_startthe adjusted seek offset, from the start of the file.
This method does not require any rights.
Request
| Name | Type |
|---|---|
origin |
SeekOrigin
|
offset |
int64
|
Response
| Name | Type |
|---|---|
payload |
File_Seek_Result
|
SetExtendedAttribute
Set the value for the given attribute name to value for this node.
The attribute name may exist, in which case the attribute is updated. If the attribute doesn't exist, it is created. The name should have no null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
This method requires the Rights.UPDATE_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
name |
ExtendedAttributeName
|
value |
ExtendedAttributeValue
|
mode |
SetExtendedAttributeMode
|
Response
| Name | Type |
|---|---|
payload |
Node_SetExtendedAttribute_Result
|
SetFlags
Sets the flags that apply to this node after it has been opened. This method does not require any rights.
Only Flags.FILE_APPEND is currently supported. Calling this method without any flags will
clear append mode.
Errors:
ZX_ERR_NOT_SUPPORTED: The object does not support this feature or the specified flags.ZX_ERR_INVALID_ARGS:flagsother thanFlags.FILE_APPENDwere specified.
Request
| Name | Type |
|---|---|
flags |
Flags
|
Response
| Name | Type |
|---|---|
payload |
Node_SetFlags_Result
|
Sync
Synchronizes updates to the node to the underlying media, if it exists.
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 Sync to ensure ordering
between operations.
This method does not require any rights.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Node_Sync_Result
|
UpdateAttributes
Updates information about the node.
attributesthe presence of a table field inattributesindicates the intent to update the corresponding attribute.
Returns ZX_ERR_NOT_SUPPORTED if the node does not support any of the specified attributes.
This method requires the Rights.UPDATE_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
payload |
MutableNodeAttributes
|
Response
| Name | Type |
|---|---|
payload |
Node_UpdateAttributes_Result
|
Write
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.
The file size may grow if the seek offset plus data.length is beyond
the current end of file.
- request
datathe byte buffer to write to the file.
- response
actual_countthe number of bytes written.
Invariants
- The returned
actual_countwill never be greater thandata.length. - If the server is unable to write all the data due to e.g. not enough
space,
actual_countmay be less thandata.length. If no bytes could be written, an error is returned. - If
data.lengthis 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.
This method requires the Rights.WRITE_BYTES right.
Request
| Name | Type |
|---|---|
data |
Transfer
|
Response
| Name | Type |
|---|---|
payload |
Writable_Write_Result
|
WriteAt
Writes data at the provided offset. Does not affect the seek offset.
The file size may grow if offset plus data.length is past the
current end of file.
- request
datathe byte buffer to write to the file. - request
offsetthe offset from start of the file to begin writing.
- response
actual_countthe number of bytes written.
Invariants
- The returned
actual_countwill never be greater thandata.length. - If the server is unable to write all the data due to e.g. not enough
space,
actual_countmay be less thandata.length. If no bytes could be written, an error is returned. - If
data.lengthis zero, the server should perform all the checks ensuring write access without mutating the file, and will return a successful write of zero bytes.
This method requires the Rights.WRITE_BYTES right.
Request
| Name | Type |
|---|---|
data |
Transfer
|
offset |
uint64
|
Response
| Name | Type |
|---|---|
payload |
File_WriteAt_Result
|
Linkable
Defined in fuchsia.io/node.fidl
LinkInto
Creates a link to this this object with name dst in the directory represented by
dst_parent_token.
dst must be a resolved object name. Including "/" in the string will return
ZX_ERR_INVALID_ARGS.
This method requires the maximal set of rights supported by the filesystem for this object.
For files this would typically be Rights.READ_BYTES, Rights.WRITE_BYTES,
Rights.GET_ATTRIBUTES and Rights.UPDATE_ATTRIBUTES. Some filesystems might also
support the Rights.EXECUTE right. Insufficient rights will result in
ZX_ERR_ACCESS_DENIED.
If this object has no links and is NOT an unnamed temporary object (objects opened with
Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY), it will fail with ZX_ERR_NOT_FOUND.
For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
the object will be permanently linked to the filesystem. Requires that the unnamed temporary
object is linkable, if not, it will fail with ZX_ERR_NOT_FOUND.
This method does not have the same atomicity properties has the Directory::Link method,
which means that calling Open then LinkInto is not equivalent to Directory::Link
because LinkInto will not prevent the source from being renamed or unlinked.
Request
| Name | Type |
|---|---|
dst_parent_token |
Token
|
dst |
Name
|
Response
| Name | Type |
|---|---|
payload |
Linkable_LinkInto_Result
|
Node
Defined in fuchsia.io/node.fidl
Node defines the minimal interface for entities which can be accessed in a filesystem.
Clone
Request
| Name | Type |
|---|---|
request |
server_end:fuchsia.unknown/Cloneable
|
Close
Terminates the connection.
After calling Close, the client must not send any other requests.
Servers, after sending the status response, should close the connection regardless of status and without sending an epitaph.
Closing the client end of the channel should be semantically equivalent
to calling Close without knowing when the close has completed or its
status.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.unknown/Closeable_Close_Result
|
DeprecatedClone
DEPRECATED - Use fuchsia.unknown/Cloneable.Clone instead.
Request
| Name | Type |
|---|---|
flags |
OpenFlags
|
object |
server_end:Node
|
DeprecatedGetAttr
DEPRECATED - Use Node.GetAttributes instead.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
s |
zx/Status
|
attributes |
NodeAttributes
|
DeprecatedGetFlags
[DEPRECATED - Use new GetFlags method instead.]
Request
<EMPTY>
Response
| Name | Type |
|---|---|
s |
zx/Status
|
flags |
OpenFlags
|
DeprecatedSetAttr
DEPRECATED - Use Node.UpdateAttributes instead.
Request
| Name | Type |
|---|---|
flags |
NodeAttributeFlags
|
attributes |
NodeAttributes
|
Response
| Name | Type |
|---|---|
s |
zx/Status
|
DeprecatedSetFlags
[DEPRECATED - Use new SetFlags method instead.]
Request
| Name | Type |
|---|---|
flags |
OpenFlags
|
Response
| Name | Type |
|---|---|
s |
zx/Status
|
GetAttributes
Acquires information about the node.
The attributes of a node should be stable, independent of the specific protocol used to access it.
If a particular attribute is not applicable or not supported, filesystems should leave the corresponding field absent.
querya bit-mask specifying which attributes to fetch. The server should not return more than necessary.
attributesthe returned attributes.
This method requires the Rights.GET_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
query |
NodeAttributesQuery
|
Response
| Name | Type |
|---|---|
payload |
Node_GetAttributes_Result
|
GetExtendedAttribute
Get the value associated with the given attribute name for this node.
Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No particular structure is imposed on them.
This method requires the Rights.GET_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
name |
ExtendedAttributeName
|
Response
| Name | Type |
|---|---|
payload |
Node_GetExtendedAttribute_Result
|
GetFlags
Queries the flags that apply to this node after it has been opened/created. This method does not require any rights.
Note that the final set of flags that apply to the connection may differ from those
specified with the fuchsia.io/Directory.Open request used to create it:
Flags.PERM_INHERIT_*: Only applies when determining connection rights.Flags.PROTOCOL_*: Only the protocol of the connection will be present.Flags.FLAG_*: Only applies when opening the resource, not part of the connection.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Node_GetFlags_Result
|
ListExtendedAttributes
Creates an iterator over all the extended attribute names associated with this node. If an error occurs it is returned as an epitaph on the iterator request channel, and then the channel is closed.
GetExtendedAttributes can be used with any of these names to retrieve the associated value.
This method requires the Rights.GET_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
iterator |
server_end:ExtendedAttributeIterator
|
OnOpen
An event produced eagerly by a FIDL server if requested by OpenFlags.DESCRIBE.
Indicates the success or failure of the open operation, and optionally describes the
object. If the status is ZX_OK, info contains descriptive information about the object
(the same as would be returned by Describe).
Response
| Name | Type |
|---|---|
s |
zx/Status
|
info |
NodeInfoDeprecated?
|
OnRepresentation
An event produced eagerly by the server if requested by Flags.FLAG_SEND_REPRESENTATION. This event will be sent as the first message from the server, and is sent exactly once.
The active variant corresponds to the negotiated protocol for the target node (i.e. the protocol which this channel now speaks). Additionally, auxiliary handles and requested attributes are also returned in the event.
Response
| Name | Type |
|---|---|
payload |
Representation
|
Query
Request
<EMPTY>
Response
| Name | Type |
|---|---|
protocol |
vector<uint8>
|
QueryFilesystem
Query the filesystem for filesystem-specific information.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
s |
zx/Status
|
info |
FilesystemInfo?
|
RemoveExtendedAttribute
Remove the specified extended attribute.
If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
This method requires the Rights.UPDATE_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
name |
ExtendedAttributeName
|
Response
| Name | Type |
|---|---|
payload |
Node_RemoveExtendedAttribute_Result
|
SetExtendedAttribute
Set the value for the given attribute name to value for this node.
The attribute name may exist, in which case the attribute is updated. If the attribute doesn't exist, it is created. The name should have no null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
This method requires the Rights.UPDATE_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
name |
ExtendedAttributeName
|
value |
ExtendedAttributeValue
|
mode |
SetExtendedAttributeMode
|
Response
| Name | Type |
|---|---|
payload |
Node_SetExtendedAttribute_Result
|
SetFlags
Sets the flags that apply to this node after it has been opened. This method does not require any rights.
Only Flags.FILE_APPEND is currently supported. Calling this method without any flags will
clear append mode.
Errors:
ZX_ERR_NOT_SUPPORTED: The object does not support this feature or the specified flags.ZX_ERR_INVALID_ARGS:flagsother thanFlags.FILE_APPENDwere specified.
Request
| Name | Type |
|---|---|
flags |
Flags
|
Response
| Name | Type |
|---|---|
payload |
Node_SetFlags_Result
|
Sync
Synchronizes updates to the node to the underlying media, if it exists.
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 Sync to ensure ordering
between operations.
This method does not require any rights.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Node_Sync_Result
|
UpdateAttributes
Updates information about the node.
attributesthe presence of a table field inattributesindicates the intent to update the corresponding attribute.
Returns ZX_ERR_NOT_SUPPORTED if the node does not support any of the specified attributes.
This method requires the Rights.UPDATE_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
payload |
MutableNodeAttributes
|
Response
| Name | Type |
|---|---|
payload |
Node_UpdateAttributes_Result
|
Readable
Defined in fuchsia.io/file.fidl
Read
Reads up to 'count' bytes at the seek offset. The seek offset is moved forward by the number of bytes read.
Invariants
- The returned
data.lengthwill never be greater thancount. - If
data.lengthis less thancount, it means that the seek offset has reached the end of file as part of this operation. - If
data.lengthis zero whilecountis not, it means that the seek offset is already at or beyond the end of file, and no data could be read. - If
countis zero, the server should perform all the checks ensuring read access without actually read anything, and return an emptydatavector.
This method requires the Rights.READ_BYTES right.
Returns ZX_ERR_OUT_OF_RANGE if count is greater than MAX_TRANSFER_SIZE.
Request
| Name | Type |
|---|---|
count |
uint64
|
Response
| Name | Type |
|---|---|
payload |
Readable_Read_Result
|
Symlink
Defined in fuchsia.io/symlink.fidl
A ['Node'] which contains a symbolic link.
Clone
Request
| Name | Type |
|---|---|
request |
server_end:fuchsia.unknown/Cloneable
|
Close
Terminates the connection.
After calling Close, the client must not send any other requests.
Servers, after sending the status response, should close the connection regardless of status and without sending an epitaph.
Closing the client end of the channel should be semantically equivalent
to calling Close without knowing when the close has completed or its
status.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.unknown/Closeable_Close_Result
|
DeprecatedClone
DEPRECATED - Use fuchsia.unknown/Cloneable.Clone instead.
Request
| Name | Type |
|---|---|
flags |
OpenFlags
|
object |
server_end:Node
|
DeprecatedGetAttr
DEPRECATED - Use Node.GetAttributes instead.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
s |
zx/Status
|
attributes |
NodeAttributes
|
DeprecatedGetFlags
[DEPRECATED - Use new GetFlags method instead.]
Request
<EMPTY>
Response
| Name | Type |
|---|---|
s |
zx/Status
|
flags |
OpenFlags
|
DeprecatedSetAttr
DEPRECATED - Use Node.UpdateAttributes instead.
Request
| Name | Type |
|---|---|
flags |
NodeAttributeFlags
|
attributes |
NodeAttributes
|
Response
| Name | Type |
|---|---|
s |
zx/Status
|
DeprecatedSetFlags
[DEPRECATED - Use new SetFlags method instead.]
Request
| Name | Type |
|---|---|
flags |
OpenFlags
|
Response
| Name | Type |
|---|---|
s |
zx/Status
|
Describe
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Symlink_Describe_Result
|
GetAttributes
Acquires information about the node.
The attributes of a node should be stable, independent of the specific protocol used to access it.
If a particular attribute is not applicable or not supported, filesystems should leave the corresponding field absent.
querya bit-mask specifying which attributes to fetch. The server should not return more than necessary.
attributesthe returned attributes.
This method requires the Rights.GET_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
query |
NodeAttributesQuery
|
Response
| Name | Type |
|---|---|
payload |
Node_GetAttributes_Result
|
GetExtendedAttribute
Get the value associated with the given attribute name for this node.
Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No particular structure is imposed on them.
This method requires the Rights.GET_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
name |
ExtendedAttributeName
|
Response
| Name | Type |
|---|---|
payload |
Node_GetExtendedAttribute_Result
|
GetFlags
Queries the flags that apply to this node after it has been opened/created. This method does not require any rights.
Note that the final set of flags that apply to the connection may differ from those
specified with the fuchsia.io/Directory.Open request used to create it:
Flags.PERM_INHERIT_*: Only applies when determining connection rights.Flags.PROTOCOL_*: Only the protocol of the connection will be present.Flags.FLAG_*: Only applies when opening the resource, not part of the connection.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Node_GetFlags_Result
|
LinkInto
Creates a link to this this object with name dst in the directory represented by
dst_parent_token.
dst must be a resolved object name. Including "/" in the string will return
ZX_ERR_INVALID_ARGS.
This method requires the maximal set of rights supported by the filesystem for this object.
For files this would typically be Rights.READ_BYTES, Rights.WRITE_BYTES,
Rights.GET_ATTRIBUTES and Rights.UPDATE_ATTRIBUTES. Some filesystems might also
support the Rights.EXECUTE right. Insufficient rights will result in
ZX_ERR_ACCESS_DENIED.
If this object has no links and is NOT an unnamed temporary object (objects opened with
Flags.FLAG_CREATE_AS_UNNAMED_TEMPORARY), it will fail with ZX_ERR_NOT_FOUND.
For unnamed temporary objects, use LinkInto to give it a name. Upon successful completion,
the object will be permanently linked to the filesystem. Requires that the unnamed temporary
object is linkable, if not, it will fail with ZX_ERR_NOT_FOUND.
This method does not have the same atomicity properties has the Directory::Link method,
which means that calling Open then LinkInto is not equivalent to Directory::Link
because LinkInto will not prevent the source from being renamed or unlinked.
Request
| Name | Type |
|---|---|
dst_parent_token |
Token
|
dst |
Name
|
Response
| Name | Type |
|---|---|
payload |
Linkable_LinkInto_Result
|
ListExtendedAttributes
Creates an iterator over all the extended attribute names associated with this node. If an error occurs it is returned as an epitaph on the iterator request channel, and then the channel is closed.
GetExtendedAttributes can be used with any of these names to retrieve the associated value.
This method requires the Rights.GET_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
iterator |
server_end:ExtendedAttributeIterator
|
OnOpen
An event produced eagerly by a FIDL server if requested by OpenFlags.DESCRIBE.
Indicates the success or failure of the open operation, and optionally describes the
object. If the status is ZX_OK, info contains descriptive information about the object
(the same as would be returned by Describe).
Response
| Name | Type |
|---|---|
s |
zx/Status
|
info |
NodeInfoDeprecated?
|
OnRepresentation
An event produced eagerly by the server if requested by Flags.FLAG_SEND_REPRESENTATION. This event will be sent as the first message from the server, and is sent exactly once.
The active variant corresponds to the negotiated protocol for the target node (i.e. the protocol which this channel now speaks). Additionally, auxiliary handles and requested attributes are also returned in the event.
Response
| Name | Type |
|---|---|
payload |
Representation
|
Query
Request
<EMPTY>
Response
| Name | Type |
|---|---|
protocol |
vector<uint8>
|
QueryFilesystem
Query the filesystem for filesystem-specific information.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
s |
zx/Status
|
info |
FilesystemInfo?
|
RemoveExtendedAttribute
Remove the specified extended attribute.
If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
This method requires the Rights.UPDATE_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
name |
ExtendedAttributeName
|
Response
| Name | Type |
|---|---|
payload |
Node_RemoveExtendedAttribute_Result
|
SetExtendedAttribute
Set the value for the given attribute name to value for this node.
The attribute name may exist, in which case the attribute is updated. If the attribute doesn't exist, it is created. The name should have no null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
This method requires the Rights.UPDATE_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
name |
ExtendedAttributeName
|
value |
ExtendedAttributeValue
|
mode |
SetExtendedAttributeMode
|
Response
| Name | Type |
|---|---|
payload |
Node_SetExtendedAttribute_Result
|
SetFlags
Sets the flags that apply to this node after it has been opened. This method does not require any rights.
Only Flags.FILE_APPEND is currently supported. Calling this method without any flags will
clear append mode.
Errors:
ZX_ERR_NOT_SUPPORTED: The object does not support this feature or the specified flags.ZX_ERR_INVALID_ARGS:flagsother thanFlags.FILE_APPENDwere specified.
Request
| Name | Type |
|---|---|
flags |
Flags
|
Response
| Name | Type |
|---|---|
payload |
Node_SetFlags_Result
|
Sync
Synchronizes updates to the node to the underlying media, if it exists.
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 Sync to ensure ordering
between operations.
This method does not require any rights.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Node_Sync_Result
|
UpdateAttributes
Updates information about the node.
attributesthe presence of a table field inattributesindicates the intent to update the corresponding attribute.
Returns ZX_ERR_NOT_SUPPORTED if the node does not support any of the specified attributes.
This method requires the Rights.UPDATE_ATTRIBUTES right.
Request
| Name | Type |
|---|---|
payload |
MutableNodeAttributes
|
Response
| Name | Type |
|---|---|
payload |
Node_UpdateAttributes_Result
|
Writable
Defined in fuchsia.io/file.fidl
Write
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.
The file size may grow if the seek offset plus data.length is beyond
the current end of file.
- request
datathe byte buffer to write to the file.
- response
actual_countthe number of bytes written.
Invariants
- The returned
actual_countwill never be greater thandata.length. - If the server is unable to write all the data due to e.g. not enough
space,
actual_countmay be less thandata.length. If no bytes could be written, an error is returned. - If
data.lengthis 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.
This method requires the Rights.WRITE_BYTES right.
Request
| Name | Type |
|---|---|
data |
Transfer
|
Response
| Name | Type |
|---|---|
payload |
Writable_Write_Result
|
STRUCTS
AdvisoryLockRange
Defined in fuchsia.io/locking.fidl
| Field | Type | Description | Default |
|---|---|---|---|
origin |
SeekOrigin
|
The location in the file from which offset is computed. |
No default |
offset |
int64
|
The start of the byte range, expressed as an offset from origin. Cannot be negative if origin is SeekOrigin.START. |
No default |
length |
int64
|
The length of the byte range in bytes. If the length is zero, then the byte range extends until the end of the file, regardless of how large the file becomes. If the length is negative, the byte range includes the bytes |
No default |
AdvisoryLocking_AdvisoryLock_Response
Defined in fuchsia.io/locking.fidl
<EMPTY>
DirectoryObject
Defined in fuchsia.io/node.fidl
<EMPTY>
Directory_CreateSymlink_Response
Defined in fuchsia.io/directory.fidl
<EMPTY>
Directory_Rename_Response
Defined in fuchsia.io/directory.fidl
<EMPTY>
Directory_Unlink_Response
Defined in fuchsia.io/directory.fidl
<EMPTY>
EmptyStruct
Defined in fuchsia.io/node.fidl
Used in places where empty structs are needed, such as empty union members, to avoid creating new struct types.
<EMPTY>
ExtendedAttributeIterator_GetNext_Response
Defined in fuchsia.io/node.fidl
| Field | Type | Description | Default |
|---|---|---|---|
attributes |
vector<ExtendedAttributeName>:128
|
No default | |
last |
bool
|
No default |
FileObject resource
Defined in fuchsia.io/node.fidl
| Field | Type | Description | Default |
|---|---|---|---|
event |
handle<event>?
|
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 "readable" on a connection that does not have the capability to read. The " |
No default |
stream |
handle<stream>?
|
A placeholder for future stream support. Currently, servers are required not to send a handle in this field. |
No default |
File_Allocate_Response
Defined in fuchsia.io/file.fidl
<EMPTY>
File_EnableVerity_Response
Defined in fuchsia.io/file.fidl
<EMPTY>
File_GetBackingMemory_Response resource
Defined in fuchsia.io/file.fidl
| Field | Type | Description | Default |
|---|---|---|---|
vmo |
handle<vmo>
|
No default |
File_ReadAt_Response
Defined in fuchsia.io/file.fidl
| Field | Type | Description | Default |
|---|---|---|---|
data |
Transfer
|
No default |
File_Resize_Response
Defined in fuchsia.io/file.fidl
<EMPTY>
File_Seek_Response
Defined in fuchsia.io/file.fidl
| Field | Type | Description | Default |
|---|---|---|---|
offset_from_start |
uint64
|
No default |
File_WriteAt_Response
Defined in fuchsia.io/file.fidl
| Field | Type | Description | Default |
|---|---|---|---|
actual_count |
uint64
|
No default |
FilesystemInfo
Defined in fuchsia.io/node.fidl
| Field | Type | Description | Default |
|---|---|---|---|
total_bytes |
uint64
|
The number of data bytes which may be stored in a filesystem. This does not count metadata or other filesystem overhead like block rounding. |
No default |
used_bytes |
uint64
|
The number of data bytes which are in use by the filesystem. This does not count metadata or other filesystem overhead like block rounding. |
No default |
total_nodes |
uint64
|
The number of nodes which may be stored in the filesystem. |
No default |
used_nodes |
uint64
|
The number of nodes used by the filesystem. |
No default |
free_shared_pool_bytes |
uint64
|
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. |
No default |
fs_id |
uint64
|
A unique identifier for this filesystem instance. Will not be preserved across reboots. Implementors should create a kernel object (normally an event) and use its koid for the filesystem ID. This koid guarantees uniqueness in the system. |
No default |
block_size |
uint32
|
The size in bytes of a single filesystem block. |
No default |
max_filename_size |
uint32
|
The maximum length of a filesystem name. |
No default |
fs_type |
uint32
|
A unique identifier for the type of the underlying filesystem. |
No default |
padding |
uint32
|
No default | |
name |
array<int8, 32>
|
No default |
Linkable_LinkInto_Response
Defined in fuchsia.io/node.fidl
<EMPTY>
NodeAttributes
Defined in fuchsia.io/node.fidl
NodeAttributes defines generic information about a filesystem node.
| Field | Type | Description | Default |
|---|---|---|---|
mode |
uint32
|
Protection bits and node type information describe in 'mode'. |
No default |
id |
uint64
|
A filesystem-unique ID. |
No default |
content_size |
uint64
|
Node size, in bytes. |
No default |
storage_size |
uint64
|
Space needed to store node (possibly larger than size), in bytes. |
No default |
link_count |
uint64
|
Hard link count. |
No default |
creation_time |
uint64
|
Time of creation (may be updated manually after creation) in ns since Unix epoch, UTC. |
No default |
modification_time |
uint64
|
Time of last modification in ns since Unix epoch, UTC. |
No default |
NodeAttributes2
Defined in fuchsia.io/node.fidl
| Field | Type | Description | Default |
|---|---|---|---|
mutable_attributes |
MutableNodeAttributes
|
No default | |
immutable_attributes |
ImmutableNodeAttributes
|
No default |
Node_GetFlags_Response
Defined in fuchsia.io/node.fidl
| Field | Type | Description | Default |
|---|---|---|---|
flags |
Flags
|
No default |
Node_RemoveExtendedAttribute_Response
Defined in fuchsia.io/node.fidl
<EMPTY>
Node_SetExtendedAttribute_Response
Defined in fuchsia.io/node.fidl
<EMPTY>
Node_SetFlags_Response
Defined in fuchsia.io/node.fidl
<EMPTY>
Node_Sync_Response
Defined in fuchsia.io/node.fidl
<EMPTY>
Node_UpdateAttributes_Response
Defined in fuchsia.io/node.fidl
<EMPTY>
Readable_Read_Response
Defined in fuchsia.io/file.fidl
| Field | Type | Description | Default |
|---|---|---|---|
data |
Transfer
|
No default |
Service
Defined in fuchsia.io/node.fidl
<EMPTY>
SymlinkObject
Defined in fuchsia.io/node.fidl
| Field | Type | Description | Default |
|---|---|---|---|
target |
SymlinkTarget
|
No default |
Writable_Write_Response
Defined in fuchsia.io/file.fidl
| Field | Type | Description | Default |
|---|---|---|---|
actual_count |
uint64
|
No default |
ENUMS
AdvisoryLockType strict
Type: uint32
Defined in fuchsia.io/locking.fidl
| Name | Value | Description |
|---|---|---|
READ |
1 |
Zero or more connections can hold read locks on a file simultaneously. |
WRITE |
2 |
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. |
UNLOCK |
3 |
The region specifies a region to be unlocked. |
DirentType flexible
Type: uint8
Defined in fuchsia.io/directory.fidl
| Name | Value | Description |
|---|---|---|
UNKNOWN |
0 |
A dirent with an unknown type. |
DIRECTORY |
4 |
A dirent representing a directory object. |
BLOCK_DEVICE |
6 |
A dirent representing a block device object. |
FILE |
8 |
A dirent representing a file object. |
SYMLINK |
10 |
A symbolic link. Added: 18
|
SERVICE |
16 |
A dirent representing a service object. |
HashAlgorithm flexible
Type: uint8
Defined in fuchsia.io/file.fidl
Denotes which hash algorithm is used to build the merkle tree for fsverity-enabled files.
| Name | Value | Description |
|---|---|---|
SHA256 |
1 |
|
SHA512 |
2 |
SeekOrigin strict
Type: uint32
Defined in fuchsia.io/file.fidl
The reference point for updating the seek offset. See File.Seek.
This enum matches the zx_stream_seek_origin_t enum.
| Name | Value | Description |
|---|---|---|
START |
0 |
Seek from the start of the file.
The seek offset will be set to |
CURRENT |
1 |
Seek from the current position in the file.
The seek offset will be the current seek offset plus |
END |
2 |
Seek from the end of the file.
The seek offset will be the file size plus |
SetExtendedAttributeMode strict
Type: uint32
Defined in fuchsia.io/node.fidl
| Name | Value | Description |
|---|---|---|
SET |
1 |
Set the value of the extended attribute regardless of whether it already exists. |
CREATE |
2 |
Create a new extended attribute. Fail if it already exists. |
REPLACE |
3 |
Replace the value of an existing extended attribute. Fail if it doesn't already exist. |
WatchEvent strict
Type: uint8
Defined in fuchsia.io/directory.fidl
| Name | Value | Description |
|---|---|---|
DELETED |
0 |
Indicates the directory being watched has been deleted. The name returned for this event
will be |
ADDED |
1 |
Indicates a node has been created (either new or moved) into a directory. |
REMOVED |
2 |
Identifies a node has been removed (either deleted or moved) from the directory. |
EXISTING |
3 |
Identifies a node already existed in the directory when watching started. |
IDLE |
4 |
Identifies that no more |
TABLES
AdvisoryLockRequest
Defined in fuchsia.io/locking.fidl
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
type |
AdvisoryLockType
|
The type of lock to be acquired. If this field is absent, the AdvisoryLock method will fail with ZX_ERR_INVALID_ARGS. |
2 |
range |
AdvisoryLockRange
|
The byte range within the file to be locked. The range can extend beyond the end of the file but cannot extend beyond the beginning of the file. If this field is absent, the range defaults to the entire file. |
3 |
wait |
bool
|
Whether the file should wait reply to the AdvisoryLock method until the requested lock can be acquired. If this field is absent, the file will not wait. |
ConnectionInfo resource
Defined in fuchsia.io/node.fidl
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
rights |
Rights
|
The rights possessed by the current connection. Note: |
DirectoryInfo
Defined in fuchsia.io/directory.fidl
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
attributes |
NodeAttributes2
|
Requested attributes for the directory. This is only populated if requested. Added: 18
|
FileInfo resource
Defined in fuchsia.io/file.fidl
Auxiliary data for the file representation of a node.
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
is_append |
bool
|
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. |
2 |
observer |
handle<event>
|
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 "readable" on a connection that does not have the capability to read. This event will be present if the following conditions are met:
The FileSignal values may be observed on this event. |
3 |
stream |
handle<stream>
|
An optional stream object, which can be used to read to and write from the file. 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 File protocol. |
4 |
attributes |
NodeAttributes2
|
Requested attributes for the file. This is only populated if requested. Added: 18
|
ImmutableNodeAttributes
Defined in fuchsia.io/node.fidl
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
protocols |
NodeProtocolKinds
|
Describes the kinds of representations supported by the node.
Note: This is not the result of the connection-time negotiation,
which is conveyed via |
2 |
abilities |
Abilities
|
Describes the kinds of operations supported by the node. Note: This is distinct from the rights used at connection time. |
3 |
content_size |
uint64
|
Node size, in bytes. |
4 |
storage_size |
uint64
|
Space needed to store the node (possibly larger than size), in bytes. |
5 |
link_count |
uint64
|
Number of hard links to the node. It must be at least one. |
6 |
id |
Id
|
An ID for the node. See Id.
This |
7 |
change_time |
uint64
|
Time of last change to the metadata in nanoseconds since the Unix epoch, UTC. Added: 18
|
8 |
options |
VerificationOptions
|
Contains the verification options for verity-enabled files. Added: HEAD
|
9 |
root_hash |
vector<uint8>:64
|
The root hash for the file. Not all filesystems support this across all files. Added: HEAD
|
10 |
verity_enabled |
bool
|
True if this file is verity-enabled. Added: HEAD
|
MutableNodeAttributes
Defined in fuchsia.io/node.fidl
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
creation_time |
uint64
|
Time of creation in nanoseconds since the Unix epoch, UTC. |
2 |
modification_time |
uint64
|
Time of last modification in nanoseconds since the Unix epoch, UTC. |
3 |
mode |
uint32
|
POSIX compatibility attributes. Most filesystems will not support these. Those that do must simply store and retrieve them (e.g. as extended attributes) and not attempt to interpret them (e.g. by doing permission checks or handling device opens specially). Added: 18
|
4 |
uid |
uint32
|
Added: 18
|
5 |
gid |
uint32
|
Added: 18
|
6 |
rdev |
uint64
|
Added: 18
|
7 |
access_time |
uint64
|
Time of last access in nanoseconds since the Unix epoch, UTC. Note that servers might not always update this if this is the only attribute being updated. Added: 18
|
8 |
casefold |
bool
|
Casefold (case-insensitive filename) support This attribute can only be changed on empty directories and will be inherited by any child directories that are subsequently created. The only filesystem to support this at the time of writing is Fxfs. Added: HEAD
|
9 |
selinux_context |
SelinuxContext
|
The value of the extended attribute "security.selinux" to be used in the context of SELinux
implementations. The value can only be set or returned if it is
MAX_SELINUX_CONTEXT_ATTRIBUTE_LEN characters or less to constrain the size of the
response. If the value is not currently found on the node the response the field will not
be included in the response. If the value is found on the node but the server is not
returning it here due to size or implementation, then it will return
ZX_ERR_INVALID_ARGS will be returned if there is an attempt set this attribute with the
Added: HEAD
|
10 |
wrapping_key_id |
array<uint8, 16>
|
Fscrypt support This attribute can only be changed on empty directories and will be inherited by any child directories that are subsequently created. This attribute can only be set once per directory. The wrapping_key_id set will be used to encrypt file contents and filenames for this directory and its children. The only filesystem to support this at the time of writing is Fxfs. Added: HEAD
|
NodeInfo
Defined in fuchsia.io/node.fidl
Information that describes the target node.
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
attributes |
NodeAttributes2
|
Options
Defined in fuchsia.io/directory.fidl
Options which can be used when opening nodes. Unlike Flags, these options are designed for specific use cases (e.g. to reduce round-trip latency when requesting attributes).
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
attributes |
NodeAttributesQuery
|
Request a set of attributes to be sent with the OnRepresentation response. Has no effect
if |
2 |
create_attributes |
MutableNodeAttributes
|
Request a set of attributes to be set atomically when creating a new object. Requests will
fail with |
SymlinkInfo
Defined in fuchsia.io/symlink.fidl
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
target |
SymlinkTarget
|
The symbolic link has no meaning on the server; the client is free to interpret the target however it chooses. |
2 |
attributes |
NodeAttributes2
|
Requested attributes for the symbolic link. This is only populated if requested. |
UnlinkOptions
Defined in fuchsia.io/directory.fidl
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
flags |
UnlinkFlags
|
VerificationOptions
Defined in fuchsia.io/file.fidl
Set of options used to enable verity on a file.
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
hash_algorithm |
HashAlgorithm
|
|
2 |
salt |
vector<uint8>:32
|
|
UNIONS
AdvisoryLocking_AdvisoryLock_Result strict
Defined in fuchsia.io/locking.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
AdvisoryLocking_AdvisoryLock_Response
|
|
2 |
err |
zx/Status
|
Directory_CreateSymlink_Result strict
Defined in fuchsia.io/directory.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Directory_CreateSymlink_Response
|
|
2 |
err |
zx/Status
|
Directory_Rename_Result strict
Defined in fuchsia.io/directory.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Directory_Rename_Response
|
|
2 |
err |
zx/Status
|
Directory_Unlink_Result strict
Defined in fuchsia.io/directory.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Directory_Unlink_Response
|
|
2 |
err |
zx/Status
|
ExtendedAttributeIterator_GetNext_Result strict
Defined in fuchsia.io/node.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
ExtendedAttributeIterator_GetNext_Response
|
|
2 |
err |
zx/Status
|
ExtendedAttributeValue flexible resource
Defined in fuchsia.io/node.fidl
The value type for an extended attribute. If the value is less than 32768 bytes, then it is included inline. Values larger than this size are written into a vmo buffer.
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
bytes |
vector<uint8>:32768
|
|
2 |
buffer |
handle<vmo>
|
File_Allocate_Result strict
Defined in fuchsia.io/file.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
File_Allocate_Response
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|
File_EnableVerity_Result strict
Defined in fuchsia.io/file.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
File_EnableVerity_Response
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|
File_GetBackingMemory_Result strict resource
Defined in fuchsia.io/file.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
File_GetBackingMemory_Response
|
|
2 |
err |
zx/Status
|
File_ReadAt_Result strict
Defined in fuchsia.io/file.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
File_ReadAt_Response
|
|
2 |
err |
zx/Status
|
File_Resize_Result strict
Defined in fuchsia.io/file.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
File_Resize_Response
|
|
2 |
err |
zx/Status
|
File_Seek_Result strict
Defined in fuchsia.io/file.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
File_Seek_Response
|
|
2 |
err |
zx/Status
|
File_WriteAt_Result strict
Defined in fuchsia.io/file.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
File_WriteAt_Response
|
|
2 |
err |
zx/Status
|
Linkable_LinkInto_Result strict
Defined in fuchsia.io/node.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Linkable_LinkInto_Response
|
|
2 |
err |
zx/Status
|
NodeInfoDeprecated strict resource
Defined in fuchsia.io/node.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
service |
Service
|
No protocol information was supplied by the connection. |
2 |
file |
FileObject
|
The connection composes File. |
3 |
directory |
DirectoryObject
|
The connection composes Directory. |
4 |
symlink |
SymlinkObject
|
The connection composes ['Symlink']. Added: 18
|
Node_GetAttributes_Result strict
Defined in fuchsia.io/node.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
NodeAttributes2
|
|
2 |
err |
zx/Status
|
Node_GetExtendedAttribute_Result strict resource
Defined in fuchsia.io/node.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
ExtendedAttributeValue
|
|
2 |
err |
zx/Status
|
Node_GetFlags_Result strict
Defined in fuchsia.io/node.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Node_GetFlags_Response
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|
Node_RemoveExtendedAttribute_Result strict
Defined in fuchsia.io/node.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Node_RemoveExtendedAttribute_Response
|
|
2 |
err |
zx/Status
|
Node_SetExtendedAttribute_Result strict
Defined in fuchsia.io/node.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Node_SetExtendedAttribute_Response
|
|
2 |
err |
zx/Status
|
Node_SetFlags_Result strict
Defined in fuchsia.io/node.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Node_SetFlags_Response
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|
Node_Sync_Result strict
Defined in fuchsia.io/node.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Node_Sync_Response
|
|
2 |
err |
zx/Status
|
Node_UpdateAttributes_Result strict
Defined in fuchsia.io/node.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Node_UpdateAttributes_Response
|
|
2 |
err |
zx/Status
|
Readable_Read_Result strict
Defined in fuchsia.io/file.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Readable_Read_Response
|
|
2 |
err |
zx/Status
|
Representation flexible resource
Defined in fuchsia.io/node.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
node |
NodeInfo
|
The Node protocol was negotiated for this connection. Added: 27
|
2 |
directory |
DirectoryInfo
|
The File protocol was negotiated for this connection. |
3 |
file |
FileInfo
|
The File protocol was negotiated for this connection. |
4 |
symlink |
SymlinkInfo
|
The Symlink protocol was negotiated for this connection. Added: 18
|
SelinuxContext flexible
Defined in fuchsia.io/node.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
data |
vector<uint8>:256
|
|
2 |
use_extended_attributes |
EmptyStruct
|
Symlink_Describe_Result strict
Defined in fuchsia.io/symlink.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
SymlinkInfo
|
|
3 |
framework_err |
internal
|
Writable_Write_Result strict
Defined in fuchsia.io/file.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Writable_Write_Response
|
|
2 |
err |
zx/Status
|
BITS
AllocateMode flexible
Type: uint32
Defined in fuchsia.io/file.fidl
| Name | Value | Description |
|---|---|---|
KEEP_SIZE |
1 | |
UNSHARE_RANGE |
2 | |
PUNCH_HOLE |
4 | |
COLLAPSE_RANGE |
8 | |
ZERO_RANGE |
16 | |
INSERT_RANGE |
32 |
FileSignal strict
Type: uint32
Defined in fuchsia.io/file.fidl
| Name | Value | Description |
|---|---|---|
READABLE |
16777216 | Indicates the file is ready for reading. |
WRITABLE |
33554432 | Indicates the file is ready for writing. |
Flags flexible
Type: uint64
Defined in fuchsia.io/directory.fidl
Flags used to specify how a node should be opened. Note that ranges of bits are reserved for specific use cases:
- Bits 1-16: Permission flags
PERM_(e.g. Flags.PERM_READBYTES). - Bits 17-32: POSIX compatibile
Oflags (e.g. Flags.FILE_TRUNCATE orO_TRUNC). - Bits 33-64: Fuchsia-specific flags.
| Name | Value | Description |
|---|---|---|
PERM_CONNECT |
1 | Allows opening child nodes with PROTOCOL_SERVICE. |
PERM_READ_BYTES |
2 | Read byte contents of a file. |
PERM_WRITE_BYTES |
4 | Write byte contents to a file. |
PERM_EXECUTE |
8 | Execute byte contents of a file. |
PERM_GET_ATTRIBUTES |
16 | Get/query attributes of a node. |
PERM_UPDATE_ATTRIBUTES |
32 | Set/update attributes of a node. |
PERM_ENUMERATE |
64 | Enumerate (list) directory entries. |
PERM_TRAVERSE |
128 | Allow opening a child node with a node protocol. Must be specified with PERM_ENUMERATE
otherwise requests will fail with |
PERM_MODIFY_DIRECTORY |
256 | Modify directory entries (create/rename/link/unlink). Must be specified with
PERM_ENUMERATE otherwise requests will fail with |
PERM_INHERIT_WRITE |
8192 | Inherit write permissions when available (PERM_WRITE_BYTES, PERM_UPDATE_ATTRIBUTES, PERM_MODIFY_DIRECTORY, /// PERM_ENUMERATE). Servers must ensure this flag is removed if the parent connection lacks any of these rights. See INHERITED_WRITE_PERMISSIONS for the exact set of permissions that will be inherited. |
PERM_INHERIT_EXECUTE |
16384 | Inherit execute permission when available (PERM_EXECUTE). Servers must ensure this flag is removed if the parent connection lacks PERM_EXECUTE. |
PROTOCOL_SERVICE |
4294967296 | Connect to the underlying protocol if this is a service node. The caller must determine the
correct protocol to use (e.g. based on path). Unless used with PROTOCOL_NODE, specifying
other flags with the request will fail with |
PROTOCOL_NODE |
4194304 | Connect to the underlying node. Takes precedence over other protocols. If other |
PROTOCOL_DIRECTORY |
524288 | Caller accepts fuchsia.io/Directory protocol. Equivalent to POSIX |
PROTOCOL_FILE |
8589934592 | Caller accepts fuchsia.io/File protocol. |
PROTOCOL_SYMLINK |
17179869184 | Caller accepts fuchsia.io/Symlink protocol. |
FLAG_SEND_REPRESENTATION |
1099511627776 | Caller requests a fuchsia.io/Node.OnRepresentation event on success. |
FLAG_MAYBE_CREATE |
65536 | Create a new object if one doesn't exist, otherwise open an existing object. If set, a
single |
FLAG_MUST_CREATE |
131072 | Create a new object if one doesn't exist, otherwise fail the request with
|
FLAG_CREATE_AS_UNNAMED_TEMPORARY |
34359738368 | Create a new unnamed temporary object. The object is temporary until it is linked to the
filesystem. If specified with
Added: HEAD
|
FILE_APPEND |
1048576 | Open the file in append mode. The seek pointer will be moved to end-of-file (EOF)
before all writes. Equivalent to POSIX |
FILE_TRUNCATE |
262144 | Truncate the file to zero length upon opening it. Equivalent to POSIX |
ModeType strict
Type: uint32
Defined in fuchsia.io/directory.fidl
| Name | Value | Description |
|---|---|---|
DO_NOT_USE |
2147483648 |
NodeAttributeFlags strict
Type: uint32
Defined in fuchsia.io/node.fidl
The fields of 'attributes' which are used to update the Node are indicated by the 'flags' argument.
| Name | Value | Description |
|---|---|---|
CREATION_TIME |
1 | |
MODIFICATION_TIME |
2 |
NodeAttributesQuery flexible
Type: uint64
Defined in fuchsia.io/node.fidl
| Name | Value | Description |
|---|---|---|
PROTOCOLS |
1 | Requests NodeAttributes.protocols. |
ABILITIES |
2 | Requests NodeAttributes.abilities. |
CONTENT_SIZE |
4 | Requests NodeAttributes.content_size. |
STORAGE_SIZE |
8 | Requests NodeAttributes.storage_size. |
LINK_COUNT |
16 | Requests NodeAttributes.link_count. |
ID |
32 | Requests NodeAttributes.id. |
CREATION_TIME |
64 | Requests NodeAttributes.creation_time. |
MODIFICATION_TIME |
128 | Requests NodeAttributes.modification_time. |
MODE |
256 | Posix attributes. Added: 18
|
UID |
512 | Added: 18
|
GID |
1024 | Added: 18
|
RDEV |
2048 | Added: 18
|
ACCESS_TIME |
4096 | Added: 18
|
CHANGE_TIME |
8192 | Added: 18
|
OPTIONS |
16384 | Verity attributes. Added: HEAD
|
ROOT_HASH |
32768 | Added: HEAD
|
VERITY_ENABLED |
65536 | Added: HEAD
|
CASEFOLD |
131072 | Casefold (case-insensitive filename) support. When true, file lookups will be case-insensitive but case-preserving. i.e. "Foo" will be stored verbatim but can be opened as "foo", "fOO", etc. Casefolding is done in accordance to the Unicode 12 NFD normalization and casefolding standard. Added: HEAD
|
SELINUX_CONTEXT |
262144 | Requests MutableNodeAttributes.selinux_context. See that field for more detail. Added: HEAD
|
WRAPPING_KEY_ID |
524288 | fscrypt attribute. Added: HEAD
|
PENDING_ACCESS_TIME_UPDATE |
1048576 | When this is queried in fuchsia.io/Node.GetAttributes, it indicates to the filesystem that this node has been accessed and is pending an access time update given that any one of the following conditions are met:
If any of the above conditions are met, This is compatible with Linux relatime mount. The rationale behind adding this WARNING: If this is queried without a prior file access, as long as the above conditions are met, the node's access time will be updated. Not all filesystems will support this. The query will be ignored if the filesystem does not support this. Added: HEAD
|
NodeProtocolKinds flexible
Type: uint64
Defined in fuchsia.io/node-protocols.fidl
A node may have multiple supported representations when opening, even though it may have a fixed underlying identity.
Today, a file is accessed via the File protocol, and sends a
Representation.FileInfo when opened with GET_REPRESENTATION. However,
in the future we might introduce a more sophisticated FileV2 protocol, or
a more efficient SuperFastFile backed by a specialized kernel object. New
clients can request the more advanced representations by specifying the
corresponding bits in NodeProtocolKinds, whereas existing clients would
continue to talk to the node via the old representation.
NodeProtocolKinds enables forward-compatibility through a form of protocol negotiation.
The elements have one-to-one correspondence with the members of Representation.
| Name | Value | Description |
|---|---|---|
CONNECTOR |
1 | The connector representation of a node. The connection will speak either Node or the target protocol, depending on the flags used during opening. |
DIRECTORY |
2 | The directory representation of a node. The connection will speak the Directory protocol. |
FILE |
4 | The file representation of a node. The connection will speak the File protocol. |
SYMLINK |
8 | The symlink representation of a node. The connection will speak the Symlink protocol. Added: HEAD
|
OpenFlags strict
Type: uint32
Defined in fuchsia.io/directory.fidl
DEPRECATED - Use Flags instead.
| Name | Value | Description |
|---|---|---|
RIGHT_READABLE |
1 | Can read from target object. |
RIGHT_WRITABLE |
2 | Can write to target object. |
RIGHT_EXECUTABLE |
8 | Connection can map target object executable. |
CREATE |
65536 | Create the object if it doesn't exist. |
CREATE_IF_ABSENT |
131072 | (with Create) Fail if the object already exists. |
TRUNCATE |
262144 | Truncate the object before usage. |
DIRECTORY |
524288 | Assert that the object to be opened is a directory. Return an error if the target object is not a directory. |
APPEND |
1048576 | Seek to the end of the object before all writes. |
NODE_REFERENCE |
4194304 | Open a reference to the object, not the object itself.
It is ONLY valid to pass the following flags together with
|
DESCRIBE |
8388608 | Requests that an "OnOpen" event is sent to the interface request. The event will contain a non-null |
POSIX_WRITABLE |
134217728 | Specify this flag to request POSIX-compatibility with respect to write permission handling. Currently, it affects permission handling specifically during Open:
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. 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. |
POSIX_EXECUTABLE |
268435456 | Specify this flag to request POSIX-compatibility with respect to execute permission handling. Currently, it affects permission handling specifically during Open:
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. 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. |
NOT_DIRECTORY |
33554432 | Assert that the object to be opened is not a directory. Return an error if the target object is a directory. |
CLONE_SAME_RIGHTS |
67108864 | 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 |
BLOCK_DEVICE |
16777216 | Open the target object as a block device. |
Operations strict
Type: uint64
Defined in fuchsia.io/rights-abilities.fidl
The common members definition behind Rights and Abilities. Some operations may apply only to certain node types (e.g. Operations.MODIFY_DIRECTORY only applies to directories).
| Name | Value | Description |
|---|---|---|
CONNECT |
1 | Connecting to a service in a directory. |
READ_BYTES |
2 | Read byte contents of a node or its children. |
WRITE_BYTES |
4 | Writing to the byte contents of a node or its children. |
EXECUTE |
8 | Execute the byte contents of a node or its children. |
GET_ATTRIBUTES |
16 | Reading the attributes of a node and/or its children. |
UPDATE_ATTRIBUTES |
32 | Updating the attributes of a node and/or its children. |
ENUMERATE |
64 | Reading the list of nodes in a directory. |
TRAVERSE |
128 | Opening a node from a directory. Must be specified with Rights.ENUMERATE, as directory contents can be probed by opening children. |
MODIFY_DIRECTORY |
256 | Modifying the list of nodes in a directory, e.g. creating, renaming, link/unlink, etc... Must be specified with Rights.ENUMERATE, as directory contents can be probed via name conflicts during node creation. |
UnlinkFlags flexible
Type: uint64
Defined in fuchsia.io/directory.fidl
| Name | Value | Description |
|---|---|---|
MUST_BE_DIRECTORY |
1 | If set, the unlink will fail (with ZX_ERR_NOT_DIR) if the object is not a directory. |
VmoFlags strict
Type: uint32
Defined in fuchsia.io/file.fidl
| Name | Value | Description |
|---|---|---|
READ |
1 | Requests that the VMO be readable. |
WRITE |
2 | Requests that the VMO be writable. |
EXECUTE |
4 | Request that the VMO be executable. |
PRIVATE_CLONE |
65536 | 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 A private clone uses at least the guarantees of the
In some cases, clients requiring a guaranteed snapshot of the
file can use |
SHARED_BUFFER |
131072 | 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 The returned VMO may not be resizable even when |
WatchMask strict
Type: uint32
Defined in fuchsia.io/directory.fidl
| Name | Value | Description |
|---|---|---|
DELETED |
1 | Used by |
ADDED |
2 | Used by |
REMOVED |
4 | Used by |
EXISTING |
8 | Used by |
IDLE |
16 | Used by |
CONSTANTS
| Name | Value | Type | Description |
|---|---|---|---|
| DIRECTORY_PROTOCOL_NAME | fuchsia.io/Directory |
String |
Removed: 29
|
| FILE_PROTOCOL_NAME | fuchsia.io/File |
String |
Removed: 29
|
| FLAG_TEMPORARY_AS_NOT_LINKABLE | Specifies that this object is not linkable. This is only intended to be used in the context of
creating a temporary unnamed objects. When that is not the case, the node protocol defines if it
is linkable (i.e. if it composes the CAUTION: if The reason for overloading Added: HEAD
|
||
| INHERITED_WRITE_PERMISSIONS | Set of rights that Flags.PERM_INHERIT_WRITE will inherit from the parent connection if specified. Note that if any of these permissions are missing from the connection, none of these permissions will be inherited. |
||
| INO_UNKNOWN |
18446744073709551615
|
uint64 |
Nodes which do not have ino values should return this value from Readdir and GetAttr. |
| MASK_KNOWN_PERMISSIONS | |||
| MASK_KNOWN_PROTOCOLS | |||
| MASK_PERMISSION_FLAGS |
65535
|
uint64 |
|
| MASK_POSIX_FLAGS |
4294967295
|
uint64 |
|
| MAX_ATTRIBUTE_NAME |
255
|
uint64 |
The maximum size for an extended attribute name. Added: 18
|
| MAX_BUF |
8192
|
uint64 |
The maximal buffer size which can be transmitted for buffered operations. This capacity is currently set somewhat arbitrarily. |
| MAX_FILENAME |
255
|
uint64 |
The maximum length, in bytes, of a single filesystem component. Removed: HEAD Deprecated: 27
|
| MAX_FS_NAME_BUFFER |
32
|
uint64 |
|
| MAX_INLINE_ATTRIBUTE_VALUE |
32768
|
uint64 |
The maximum size for an extended attribute value to be included inline. Values larger than this size are passed in a vmo. Added: 18
|
| MAX_LIST_ATTRIBUTES_CHUNK |
128
|
uint64 |
The maximum size of a chunk in the ListExtendedAttributes iterator. Added: 18
|
| MAX_NAME_LENGTH |
255
|
uint64 |
The maximum length, in bytes, of a single filesystem component. |
| MAX_PATH_LENGTH |
4095
|
uint64 |
The maximum length, in bytes, of a filesystem path. |
| MAX_SELINUX_CONTEXT_ATTRIBUTE_LEN |
256
|
uint64 |
The maximum size for passing the SELinux context as an attribute. Added: HEAD
|
| MAX_TRANSFER_SIZE |
8192
|
uint64 |
The maximum I/O size that is allowed for read/write operations using byte vectors. |
| NODE_PROTOCOL_NAME | fuchsia.io/Node |
String |
Removed: 29
|
| OPEN_FLAGS_ALLOWED_WITH_NODE_REFERENCE | Flags used when opening a node reference must fall within this mask. |
||
| OPEN_RIGHTS | All known rights. |
||
| PERM_EXECUTABLE | Set of permissions that are expected when opening a node as executable. |
||
| PERM_READABLE | Set of permissions that are expected when opening a node as readable. |
||
| PERM_WRITABLE | Set of permissions that are expected when opening a node as writable. |
||
| RW_STAR_DIR | Alias for directory permission alias rw* |
||
| RX_STAR_DIR | Alias for directory permission alias rx* |
||
| R_STAR_DIR | Alias for directory permission alias r* |
||
| SELINUX_CONTEXT_NAME | security.selinux |
String |
The name of the extended attribute accessible via the SELinux context attribute. Added: HEAD
|
| SYMLINK_PROTOCOL_NAME | fuchsia.io/Symlink |
String |
Removed: 29 Added: 18
|
| W_STAR_DIR | Alias for directory permission alias w* |
||
| X_STAR_DIR | Alias for directory permission alias x* |
ALIASES
| Name | Value | Description |
|---|---|---|
| Abilities |
fuchsia.io/Operations |
Abilities are properties intrinsic to a node. They specify which operations are supported by it. Invoking an operation on a node that does not support it results in |
| ExtendedAttributeName |
vector[MAX_ATTRIBUTE_NAME] |
The name of an extended attribute. It can not contain any null bytes. Other than that and the maximum size, no particular structure is imposed on the name. Added: 18
|
| Id |
uint64 |
The type to identify a node, if the implementation supports some notion of unique node ID. Uniqueness GuaranteesA 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 The fuchsia.fs/FilesystemInfo.fs_id field may be used to disambiguate IDs from different backing instances. |
| Name |
string[MAX_NAME_LENGTH] |
The type for the name of a node, i.e. a single path component.
E.g. InvariantsA valid node name must meet the following criteria:
|
| Path |
string[MAX_PATH_LENGTH] |
A path is a string of one or more components, separated by "/".
E.g. InvariantsA valid path must meet the following criteria:
Paths should be transformed into their canonical forms at client side.
For example, a client should convert |
| Rights |
fuchsia.io/Operations |
Rights are properties specific to a connection. They limit which operations are allowed on a connection, including those which may be granted to new connections. Invoking an operation without the corresponding right results in |
| SymlinkTarget |
vector[MAX_PATH_LENGTH] |
|
| Token |
zx/Handle |
The type to identify a connection to a node. It represents a capability: a reference to a node with associated rights. |
| Transfer |
vector[MAX_TRANSFER_SIZE] |
The byte vector type used for read/write operations. |