Skip to content

Instantly share code, notes, and snippets.

@aoirint
Last active March 7, 2023 20:27
Show Gist options
  • Save aoirint/0dfa37ee10ac870f0ea82defc2a8d393 to your computer and use it in GitHub Desktop.
Save aoirint/0dfa37ee10ac870f0ea82defc2a8d393 to your computer and use it in GitHub Desktop.
var tempFileLastLength = 0;
final tempFileSystemEventSubscription = tempFile.watch(events: FileSystemEvent.all).listen((event) {
tempFile
.openRead(tempFileLastLength)
.transform(utf8.decoder)
.transform(const LineSplitter())
.forEach((lineText) {
// TODO: tempFileLastLength += lineTextのデコード前のバイト数
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment