rbc has asked for the wisdom of the Perl Monks concerning the following question:
... Here's what is does ...#!/usr/bin/perl -w use strict; open( FH, ">junk.dat" ) or die "dang it!\n"; my $num = 1234; syswrite ( FH, $num ); close FH;
$ ./bi#include <stdio.h> main() { FILE *fh; int num = 1234; if(( fh = fopen( "junkc.dat", "w" ) ) == NULL ) { printf ("Cannot open it\n"); exit(); } fwrite( &num, sizeof(int), 1, fh); fclose( fh ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: writing binary data in perl
by dws (Chancellor) on Apr 11, 2002 at 22:24 UTC | |
by sfink (Deacon) on Apr 12, 2002 at 00:44 UTC | |
by jmcnamara (Monsignor) on Apr 12, 2002 at 07:43 UTC | |
by sfink (Deacon) on Apr 12, 2002 at 21:14 UTC | |
by jmcnamara (Monsignor) on Apr 12, 2002 at 22:31 UTC | |
|
Re: writing binary data in perl
by jmcnamara (Monsignor) on Apr 12, 2002 at 07:38 UTC |