use Fcntl 'O_CREAT', 'O_RDWR';
require 5.005;
-$VERSION = "0.12";
+$VERSION = "0.13";
# Idea: The object will always contain an array of byte offsets
# this will be filled in as is necessary and convenient.
my $good = 1;
local *F;
open F, $file or die "Couldn't open file $file: $!";
+ binmode F;
local $/ = $self->{recsep};
unless ($self->{offsets}[0] == 0) {
$warn && print STDERR "# rec 0: offset <$self->{offsets}[0]> s/b 0!\n";
=head1 SYNOPSIS
- # This file documents Tie::File version 0.12
+ # This file documents Tie::File version 0.13
tie @array, 'Tie::File', filename or die ...;
=head1 LICENSE
-C<Tie::File> version 0.12 is copyright (C) 2002 Mark Jason Dominus.
+C<Tie::File> version 0.13 is copyright (C) 2002 Mark Jason Dominus.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
=head1 WARRANTY
-C<Tie::File> version 0.12 comes with ABSOLUTELY NO WARRANTY.
+C<Tie::File> version 0.13 comes with ABSOLUTELY NO WARRANTY.
For details, see the license.
=head1 TODO
print "ok $N\n"; $N++;
open F, "> $file" or die $!;
+binmode F;
print F $data;
close F;
print "ok $N\n"; $N++;
open F, "> $file" or die $!;
+binmode F;
print F $data;
close F;
sub init_file {
my $data = shift;
open F, "> $file" or die $!;
+ binmode F;
print F $data;
close F;
}
print $integrity ? "ok $N\n" : "not ok $N\n";
$N++;
my $open = open FH, "< $file";
+ binmode FH;
my $a;
{ local $/; $a = <FH> }
print (($open && $a eq $x) ? "ok $N\n" : "not ok $N\n");
# 2-3 FETCHSIZE 0-length file
open F, "> $file" or die $!;
+binmode F;
close F;
$o = tie @a, 'Tie::File', $file;
print $o ? "ok $N\n" : "not ok $N\n";
# 4-5 FETCHSIZE positive-length file
open F, "> $file" or die $!;
+binmode F;
print F $data;
close F;
$o = tie @a, 'Tie::File', $file;
my $x = shift;
local *FH;
my $open = open FH, "< $file";
+ binmode FH;
my $a;
{ local $/; $a = <FH> }
print (($open && $a eq $x) ? "ok $N\n" : "not ok $N\n");
my $x = shift;
local *FH;
my $open = open FH, "< $file";
+ binmode FH;
my $a;
{ local $/; $a = <FH> }
print (($open && $a eq $x) ? "ok $N\n" : "not ok $N\n");
sub init_file {
my $data = shift;
open F, "> $file" or die $!;
+ binmode F;
print F $data;
close F;
}
sub init_file {
my $data = shift;
open F, "> $file" or die $!;
+ binmode F;
print F $data;
close F;
}
my $x = join 'blah', @c, '';
local *FH;
my $open = open FH, "< $file";
+ binmode FH;
my $a;
{ local $/; $a = <FH> }
print (($open && $a eq $x) ? "ok $N\n" : "not ok $N # file @c\n");
sub init_file {
my $data = shift;
open F, "> $file" or die $!;
+ binmode F;
print F $data;
close F;
}
sub init_file {
my $data = shift;
open F, "> $file" or die $!;
+ binmode F;
print F $data;
close F;
}
print "ok $N\n"; $N++;
open F, "> $file" or die $!;
+binmode F;
print F $data;
close F;