davidmoten / davidmoten/rxjava-file
Existing lines are not emitted until the file is updated
- Dominant language
- Java
- Stars
- 85
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
The existing lines are emitted only when the file changes. This is not like tail(1) which dumps directly the current content.
Is there a way to achieve this or is there a missing flag?
Currently, I worked around with:
```
FileObservable.tailer()
.file(file)
.tailText()
.startWith(Observable.defer(() -> {
try {
return Observable.from(Files.readAllLines(Paths.get(file)));
} catch (IOException e) {
return Observable.error(e);
}
})
```
(Note: I defer in order to be sure that I do not miss lines)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.