open method

  1. @override
int open(
  1. String path,
  2. int flags
)
override

open(2). Returns a file descriptor, or -1 with errno set.

Implementation

@override
int open(String path, int flags) {
  final chip = chips.where((c) => c.path == path).firstOrNull;
  if (chip == null) {
    _errno = Errno.enoent;
    return -1;
  }
  final fd = _nextFd++;
  _chipFds[fd] = chip;
  return fd;
}