Skip to content

Export EOF detection  #160

@sunshine69

Description

@sunshine69

Hi,

In my code I need to detect EOF to do some decisions (basically flush the line stack in multiline parser). However tail does not export the file handle file thus I have to write my own short func to use os.Open the file, seek to the position where tail.Tell() is and try to read one byte to see if I got error is EOF.

This is not efficient I think. In my opinion there should be a better way tail package can export the state for us. Or at least export the file handle so I don't have to call one system os.Open again.

Any ideas to solve it? Or I am missing the doco and not using it right.

Thanks for excellent work and Kind regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions