blob: 46682812c9b0d6042d7a50d2f8d81e81e8f8d567 [file] [log] [blame] [view]
# addNode method
*[<Null safety>](https://dart.dev/null-safety)*
- @override
int addNode
(String name, [Vnode](../../package-fuchsia_vfs_vfs/Vnode-class.md) node)
_<span class="feature">override</span>_
<p>Adds a directory entry associating the given <code>name</code> with <code>node</code>.
It is ok to add the same Vnode multiple times with different names.</p>
<p>Returns <code>ZX.OK</code> on success.
Returns <code>ZX.ERR_INVALID_ARGS</code> if name is illegal object name.
Returns <code>ZX.ERR_ALREADY_EXISTS</code> if there is already a node with the
given name.</p>
## Implementation
```dart
@override
int addNode(String name, Vnode node) {
if (_inheritedNodes.contains(name)) {
return ZX.ERR_ALREADY_EXISTS;
} else {
return super.addNode(name, node);
}
}
```