Google is committed to advancing racial equity for Black communities. See how.

PseudoFile class

A PseudoFile is a file-like object whose content is generated and modified dynamically on-the-fly by invoking handler functions rather than being directly persisted as a sequence of bytes.

This class is designed to allow programs to publish read-only, or read-write properties such as configuration options, debug flags, and dumps of internal state which may change dynamically.

Although PseudoFile usually contain text, they can also be used for binary data.

Read callback, is called when the connection to the file is opened and pre-populates a buffer that will be used to when serving this file content over this particular connection.

Write callback, if any, is called when the connection is closed if the file content was ever modified while the connection was open. Modifications are: calls or opening a file for writing with the openFlagTruncate flag set.




PseudoFile.readOnly (ReadFn _readFn)

Creates a new read-only PseudoFile backed by the specified read handler. ...

PseudoFile.readOnlyStr (ReadFnStr fn)

See #readOnly(). Wraps the callback, allowing it to return a String instead of a Uint8List, but otherwise behaves identical to #readOnly().

PseudoFile.readWrite (int _capacity, ReadFn _readFn, WriteFn _writeFn)

Creates new PseudoFile backed by the specified read and write handlers. ...

PseudoFile.readWriteStr (int _capacity, ReadFnStr rfn, WriteFnStr wfn)

See #readWrite(). Wraps the read callback, allowing it to return a String instead of a Uint8List. Wraps the write callback, only allowing valid UTF-8 content to be written into the file. Written bytes are converted into a string instance, and the passed to the handler. In every other aspect behaves just like #readWrite().



The hash code for this object. ...
read-only, inherited


A representation of the runtime type of the object.
read-only, inherited


close() void

Close this node and all of its bindings and children.

connect(int flags, int mode, InterfaceRequest request, [int parentFlags = Flags.fsRights]) int

Connects to this instance of PseudoFile and serves over fidl.

describe() dynamic

Return the description of this file. This function may return null if describing the node fails. In that case, the connection should be closed.

filterForNodeReference(int flags) int

Filter flags when openFlagNodeReference is passed. This will maintain compatibility with c++ layer.

inodeNumber() int

Inode number as defined in io.fidl.

noSuchMethod(Invocation invocation) dynamic

Invoked when a non-existent method or property is accessed. ...

open(int flags, int mode, String path, InterfaceRequest request, [int parentFlags = Flags.fsRights]) void

This function is called from This function parses path and opens correct node. ...

sendErrorEvent(int flags, int status, InterfaceRequest request) void

Create a error node to send onOpen event with failure status.

toString() String

Returns a string representation of this object.

type() int

Should be one of ...


operator ==(Object other) bool

The equality operator. ...