summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fml/lib/IO/Adapter/Array.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/fml/lib/IO/Adapter/Array.pm b/fml/lib/IO/Adapter/Array.pm
index 59152528..67df0278 100644
--- a/fml/lib/IO/Adapter/Array.pm
+++ b/fml/lib/IO/Adapter/Array.pm
@@ -83,6 +83,11 @@ sub open
my $flag = $args->{ flag } || 'r';
my $r_array = $self->{ _array_reference};
+ if ($flag ne 'r') {
+ $self->_error_reason("Error: type=$self->{_type} is read only.");
+ return undef;
+ }
+
# malloc()
my @elements = @$r_array;
$self->{_elements} = $r_array;