Skip to content

Existing lines are not emitted until the file is updated #10

Open
@lbovet

Description

@lbovet

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions