bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] How to print an unsigned char?


From: arnold
Subject: Re: [bug-gawk] How to print an unsigned char?
Date: Mon, 25 Feb 2019 04:30:12 -0700
User-agent: Heirloom mailx 12.5 7/5/10

Say rather that I don't intend to try to add binary I/O facilities
to the gawk core.  I have no objection to someone writing an extension
to supply binary I/O.  With -b, you can store whatever bytes you want
in a string and gawk will leave the contents alone.  That's somewhat
awkward, but not unmanageable.

Arnold

Wolfgang Laun <address@hidden> wrote:

> That's what I think, too. With the things you've mentioned it would be
> terribly awkward. Java hides the memory representation, and look at the
> heavy artillery they need to let you do binary i/o. OK, I shoots very well,
> but at a price. You don't want this in (g)awk.
>
> Thanks
> Wolfgang
>
> On Mon, 25 Feb 2019 at 08:23, <address@hidden> wrote:
>
> > Awk and gawk are the wrong language to use for binary I/O.
> >
> > If you insist on doing stuff like that, first use the -b option, so
> > that each byte in a string is treated as a character on it own.
> > Next, you can use the lshift, rshift, or, xor, and "and" functions to
> > do bit manipulations if you really want to.
> >
> > But I really think that trying to use gawk for serious bit manipulation
> > and binary I/O is forcing a square peg into a round hole, and won't work
> > well.
> >
> > Arnold



reply via email to

[Prev in Thread] Current Thread [Next in Thread]