my $self = shift->_get_self;
my ($key, $value) = @_;
- unless ( _is_writable( $self->_fh ) ) {
+ if ( $^O ne 'MSWin32' && !_is_writable( $self->_fh ) ) {
$self->_throw_error( 'Cannot write to a readonly filehandle' );
}
my $self = $_[0]->_get_self;
my $key = $_[1];
- unless ( _is_writable( $self->_fh ) ) {
+ if ( $^O ne 'MSWin32' && !_is_writable( $self->_fh ) ) {
$self->_throw_error( 'Cannot write to a readonly filehandle' );
}
##
my $self = $_[0]->_get_self;
- unless ( _is_writable( $self->_fh ) ) {
+ if ( $^O ne 'MSWin32' && !_is_writable( $self->_fh ) ) {
$self->_throw_error( 'Cannot write to a readonly filehandle' );
}
return;
}
- $self->{engine}->create_tag(
+ $self->{engine}->write_tag(
$self, $self->_base_offset, $self->_type,
chr(0)x$self->{engine}{index_size},
);
$obj, $self->tag_size( $self->{index_size} ),
);
- $self->create_tag(
+ $self->write_tag(
$obj, $obj->_base_offset, $obj->_type,
chr(0)x$self->{index_size},
);
return SIG_SIZE + $self->{data_size} + $size;
}
-sub create_tag {
+sub write_tag {
##
# Given offset, signature and content, create tag and write to disk
##
##
my $r = Scalar::Util::reftype($value) || '';
if ( $internal_ref ) {
- $self->create_tag( $obj, undef, SIG_INTERNAL,pack($self->{long_pack}, $value->_base_offset) );
+ $self->write_tag( $obj, undef, SIG_INTERNAL,pack($self->{long_pack}, $value->_base_offset) );
}
elsif ($r eq 'HASH') {
- $self->create_tag( $obj, undef, SIG_HASH, chr(0)x$self->{index_size} );
+ $self->write_tag( $obj, undef, SIG_HASH, chr(0)x$self->{index_size} );
}
elsif ($r eq 'ARRAY') {
- $self->create_tag( $obj, undef, SIG_ARRAY, chr(0)x$self->{index_size} );
+ $self->write_tag( $obj, undef, SIG_ARRAY, chr(0)x$self->{index_size} );
}
elsif (!defined($value)) {
- $self->create_tag( $obj, undef, SIG_NULL, '' );
+ $self->write_tag( $obj, undef, SIG_NULL, '' );
}
else {
- $self->create_tag( $obj, undef, SIG_DATA, $value );
+ $self->write_tag( $obj, undef, SIG_DATA, $value );
}
##
print( $fh pack($self->{long_pack}, $loc) );
- my $index_tag = $self->create_tag(
+ my $index_tag = $self->write_tag(
$obj, $loc, SIG_INDEX,
chr(0)x$self->{index_size},
);
print( $fh pack($self->{long_pack}, $loc) );
- my $blist_tag = $self->create_tag(
+ my $blist_tag = $self->write_tag(
$obj, $loc, SIG_BLIST,
chr(0)x$self->{bucket_list_size},
);
print( $fh pack($self->{long_pack}, $loc) );
- $tag = $self->create_tag(
+ $tag = $self->write_tag(
$obj, $loc, SIG_BLIST,
chr(0)x$self->{bucket_list_size},
);