We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
FifoPosix
1 parent 79df9a1 commit 45279b7Copy full SHA for 45279b7
pkgs/io_file/test/fifo_posix.dart
@@ -43,13 +43,22 @@ class FifoPosix implements Fifo {
43
subscription.resume();
44
}
45
46
+ void write(int fd, Uint8List data) {
47
+ var offset = 0;
48
+ while (offset < data.length) {
49
+ final wrote = stdlibc.write(fd, data.buffer.asUint8List(offset));
50
+ if (wrote == -1) {
51
+ throw AssertionError('write failed: ${stdlibc.errno}');
52
+ }
53
+ offset += wrote;
54
55
56
+
57
subscription = receivePort.listen(
58
(message) => switch (message) {
- Uint8List data => stdlibc.write(fd, data),
-
59
+ Uint8List data => write(fd, data),
60
Duration d => pause(d),
61
null => stdlibc.close(fd),
62
final other => throw UnsupportedError('unexpected message: $other'),
63
},
64
);
0 commit comments