Raymond Wan wrote:
Hi Chas., Jenda,
On Mon, May 11, 2009 at 6:00 PM, Chas. Owens wrote:
On Mon, May 11, 2009 at 04:50, Jenda Krynicky wrote:
From: Raymond Wan
I'm on a Linux system too; I guess I've used it for so long, I forgot
about
the situations when binary/text does matter (i.e.,
Hi Chas., Jenda,
On Mon, May 11, 2009 at 6:00 PM, Chas. Owens wrote:
> On Mon, May 11, 2009 at 04:50, Jenda Krynicky wrote:
> > From: Raymond Wan
> >> I'm on a Linux system too; I guess I've used it for so long, I forgot
> about
> >> the situations when binary/text does matter (i.e., Windows
On Mon, May 11, 2009 at 04:50, Jenda Krynicky wrote:
> From: Raymond Wan
>> On Fri, May 8, 2009 at 8:58 PM, John W. Krahn wrote:
>>
>> >
>> > That depends on the operating system you are using. I use Linux so there
>> > is no difference between "binary" and "text", except for those specific
>>
From: Raymond Wan
> On Fri, May 8, 2009 at 8:58 PM, John W. Krahn wrote:
>
> >
> > That depends on the operating system you are using. I use Linux so there
> > is no difference between "binary" and "text", except for those specific
> > applications that can't handle "binary" data. If you are o
Hi John,
On Fri, May 8, 2009 at 8:58 PM, John W. Krahn wrote:
>
> That depends on the operating system you are using. I use Linux so there
> is no difference between "binary" and "text", except for those specific
> applications that can't handle "binary" data. If you are on a system like
> DO
Raymond Wan wrote:
On 5/8/09, John W. Krahn wrote:
[snip]
That is equivalent in C to:
unsigned char decimal_number = 42;
Or another way to write that in Perl is:
my $decimal_number = pack 'C', 42;
Once you have created the appropriate strings using pack() then just
print() them.
I se
Hi Chas.,
On 5/8/09, Chas. Owens wrote:
> The place to go is http://perldoc.perl.org, and in your case
> http://perldoc.perl.org/functions/pack.html and
> http://perldoc.perl.org/functions/unpack.html. You can also get these
> docs on your machine by saying
>
> perldoc -f pack
> perldoc -f unpac
Hi John,
On 5/8/09, John W. Krahn wrote:
[snip]
> That is equivalent in C to:
>
> unsigned char decimal_number = 42;
>
> Or another way to write that in Perl is:
>
> my $decimal_number = pack 'C', 42;
>
>
> Once you have created the appropriate strings using pack() then just
> print() them.
On Fri, May 8, 2009 at 03:20, Raymond Wan wrote:
> Hi Chas,
>
> On 5/7/09, Chas. Owens wrote:
>> You use pack to create a binary value and unpack to read a binary
>> value. So, to write a file containing three 32 bit integers you say
>
> [snip]
>
> Thanks for the sample code; that worked exactly
Hi Chas,
On 5/7/09, Chas. Owens wrote:
> You use pack to create a binary value and unpack to read a binary
> value. So, to write a file containing three 32 bit integers you say
[snip]
Thanks for the sample code; that worked exactly as you said. I wasn't
getting anywhere with google; I thought
Raymond Wan wrote:
Hi all,
Hello,
I would like to write binary values to disk (as well as read them) but don't
know how to do it. In C-speak, something like this:
unsigned int foo = 42;
fwrite (&foo, sizeof (unsigned int), 1, stdout);
I think the answer involves something with pack and unp
On Thu, May 7, 2009 at 12:24, John W. Krahn wrote:
snip
> Shouldn't that be either:
>
> sysopen ...
> sysread ...
>
> Or:
>
> open ...
> read ...
>
> ?
snip
If this were C, then yes, but this is Perl and sysread takes a
filehandle. Just remember not to mix sysread and readline (or the
operator f
Chas. Owens wrote:
On Thu, May 7, 2009 at 05:45, Raymond Wan wrote:
I would like to write binary values to disk (as well as read them) but don't
know how to do it. In C-speak, something like this:
unsigned int foo = 42;
fwrite (&foo, sizeof (unsigned int), 1, stdout);
I think the answer inv
On Thu, May 7, 2009 at 05:45, Raymond Wan wrote:
> Hi all,
>
> I would like to write binary values to disk (as well as read them) but don't
> know how to do it. In C-speak, something like this:
>
> unsigned int foo = 42;
> fwrite (&foo, sizeof (unsigned int), 1, stdout);
>
> I think the answer in
Hi all,
I would like to write binary values to disk (as well as read them) but don't
know how to do it. In C-speak, something like this:
unsigned int foo = 42;
fwrite (&foo, sizeof (unsigned int), 1, stdout);
I think the answer involves something with pack and unpack, but I'm
completely lost as
15 matches
Mail list logo