| |
| |
| |
| # open method |
| |
| |
| |
| |
| *[<Null safety>](https://dart.dev/null-safety)* |
| |
| |
| |
| - @override |
| |
| void open |
| (dynamic flags, int mode, String path, [InterfaceRequest](../../package-fidl_fidl/InterfaceRequest-class.md) request, [dynamic parentFlags]) |
| |
| _<span class="feature override">override</span>_ |
| |
| |
| |
| <p>This function is called from <code>fidl_fuchsia_io.Directory#open</code>. |
| This function parses path and opens correct node.</p> |
| <p>Vnode provides a simplified implementation for non-directory types. |
| Behavior: |
| For directory types, it will throw UnimplementedError error. |
| For non empty path it will fail with <code>ERR_NOT_DIR</code>.</p> |
| |
| |
| |
| ## Implementation |
| |
| ```dart |
| @override |
| void open( |
| OpenFlags flags, int mode, String path, InterfaceRequest<Node> request, |
| [OpenFlags? parentFlags]) { |
| if (_isClosed) { |
| sendErrorEvent(flags, ZX.ERR_NOT_SUPPORTED, request); |
| return; |
| } |
| |
| final status = _validateFlags(flags); |
| if (status != ZX.OK) { |
| sendErrorEvent(flags, status, request); |
| return; |
| } |
| |
| // Forward the reqeuest on to the remote directory |
| _proxy.open(flags, mode, path, request); |
| } |
| ``` |
| |
| |
| |
| |
| |
| |
| |