Mit /dev/ttyI0 quatschen

Marco Anstett marco.anstett at okay.net
Tue Jul 27 20:07:42 CEST 1999



Florian Lohoff wrote:

> On Mon, Jul 26, 1999 at 05:45:53PM +0200, Marco Anstett wrote:
> > Hallo,
> >
> > ich habe mit /dev/ttyS0 unter Perl das gleiche Problem, daß die bereits
> > eingelesenen Daten noch irgendwo stecken und immer wieder ausgegeben werden.
> >
> > Ich hab das Gefühl, daß die Daten in einem 'Inputbuffer' liegen. Allerdings
> > hab ich keine Ahnung wo ich den einstellen soll und ob ich da überhaupt
> > irgendwas einstellen kann.
> >
> > Für Infos in dieser Sache wäre ich auch sehr dankbar.
>
> sysread vs. read ...
>
> man perlfunc::sysread
> ---------------------schnipp--------------------
>                Attempts to read LENGTH bytes of data into
>                variable SCALAR from the specified FILEHANDLE,
>                using the system call read(2).  It bypasses stdio,
>                so mixing this with other kinds of reads, print(),
>                write(), seek(), or tell() can cause confusion
>                because stdio usually buffers data.  Returns the
>                number of bytes actually read, or undef if there
>                was an error.  SCALAR will be grown or shrunk so
>                that the last byte actually read is the last byte
>                of the scalar after the read.
> ---------------------schnapp--------------------
>
> Flo
> --
> Florian Lohoff          flo at rfc822.org                  +49-5241-470566
> Good, Fast, Cheap: Pick any two (you can't have all three).  (RFC 1925)

Aus oben genannten Gründen benutze ich bereits sysread und syswrite.

Marco





More information about the Linux mailing list