#
# Make sure it works to open the file in read-only mode
#
my $file = "tf$$.txt";
print "1..13\n";
my $N = 1;
use Fcntl 'O_RDONLY';
print "ok $N\n"; $N++;
print $o ? "ok $N\n" : "not ok $N\n";
$N++;
$N++;
for my $i (0..$#items) {
$N++;
}
my $data = shift;
binmode F;
print F $data;
close F;
}
my $badrec = "Malformed";
# (10-13) When a record lacks the record seprator, we sneakily try
# to fix it. How does that work when the file is read-only?
my $good = 1;
my $warn;
local $^W = 1;
}
my $NTESTS = shift;
binmode F;
print F $badrec;
close F;
print "ok $N \# skipped - can't create improperly terminated file\n";
$N++;
}
return;
}
return 1;
}
for (@_) {
s/\n/\\n/g;
s/\r/\\r/g;
}
}
END {
undef $o;
untie @a;
}