# a regular file. set the sysopen mode
my $mode = O_RDONLY ;
- $mode |= O_BINARY if $args{'binmode'} ;
#printf "RD: BINARY %x MODE %x\n", O_BINARY, $mode ;
goto &_error ;
}
+ if ( my $binmode = $args{'binmode'} ) {
+ binmode( $read_fh, $binmode ) ;
+ }
+
# get the size of the file for use in the read loop
$size_left = -s $read_fh ;
# set the mode for the sysopen
my $mode = O_WRONLY | O_CREAT ;
- $mode |= O_BINARY if $args->{'binmode'} ;
$mode |= O_APPEND if $args->{'append'} ;
$mode |= O_EXCL if $args->{'no_clobber'} ;
}
}
+ if ( my $binmode = $args{'binmode'} ) {
+ binmode( $write_fh, $binmode ) ;
+ }
+
sysseek( $write_fh, 0, SEEK_END ) if $args->{'append'} ;