tarm / serial

BSD 3-Clause "New" or "Revised" License
1.6k stars 453 forks source link

Added GetFile interface #65

Closed kontza closed 6 years ago

kontza commented 6 years ago

Hi,

With access to the underlying file object, we can construct bufio's readers, writers and scanners.

Cheers, Juha

tarm commented 6 years ago

bufio takes an io.Reader interface (not an os.File) and so should already be compatible with serial.Port.

Why does that not work for you and why do you need to have the os.File instead?

kontza commented 6 years ago

Ignorance on my part. It hadn't occur to me to check the bufio API deep enough, to notice that indeed io.Reader, not an os.File is the input to making a new Reader.

Not much point in this GetFile()-function there.

Thanks for pointing that out.