Win32 Binary Files : binmode « File « Perl






Win32 Binary Files

    

#binmode FILEHANDLE
#binmode FILEHANDLE, DISCIPLINE

$infile="a.gif";
open( INFILE, "<$infile" );
open( OUTFILE, ">out.gif" );

binmode( INFILE );  
binmode( OUTFILE );

while ( read( INFILE, $buffer, 1024 ) ) {
    print OUTFILE $buffer;
}

close( INFILE );
close( OUTFILE );

   
    
    
    
  








Related examples in the same category

1.Change file handle to binary mode
2.Copy file by reading one file and save to another file
3.binmode command sets up a file for access in binary mode with no mapping of carriage returns.
4.Unbuffered perl io