From: Abhijit Menon-Sen Date: Fri, 1 Mar 2002 03:03:12 +0000 (+0000) Subject: Upgrade to Tie::File 0.13 (Win32 fixes.) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1768807ea66f86a1167ded3f0eee840431c881b6;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Tie::File 0.13 (Win32 fixes.) p4raw-id: //depot/perl@14919 --- diff --git a/lib/Tie/File.pm b/lib/Tie/File.pm index 5b9381b..2b6c9a5 100644 --- a/lib/Tie/File.pm +++ b/lib/Tie/File.pm @@ -5,7 +5,7 @@ use POSIX 'SEEK_SET'; 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. @@ -434,6 +434,7 @@ sub _check_integrity { 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"; @@ -498,7 +499,7 @@ Tie::File - Access the lines of a disk file via a Perl array =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 ...; @@ -692,7 +693,7 @@ C. =head1 LICENSE -C version 0.12 is copyright (C) 2002 Mark Jason Dominus. +C 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 @@ -717,7 +718,7 @@ For licensing inquiries, contact the author at: =head1 WARRANTY -C version 0.12 comes with ABSOLUTELY NO WARRANTY. +C version 0.13 comes with ABSOLUTELY NO WARRANTY. For details, see the license. =head1 TODO diff --git a/lib/Tie/File/02_fetchsize.t b/lib/Tie/File/02_fetchsize.t index aaf44f0..b7ea3a5 100644 --- a/lib/Tie/File/02_fetchsize.t +++ b/lib/Tie/File/02_fetchsize.t @@ -10,6 +10,7 @@ use Tie::File; print "ok $N\n"; $N++; open F, "> $file" or die $!; +binmode F; print F $data; close F; diff --git a/lib/Tie/File/03_longfetch.t b/lib/Tie/File/03_longfetch.t index 7e36962..83f011e 100644 --- a/lib/Tie/File/03_longfetch.t +++ b/lib/Tie/File/03_longfetch.t @@ -16,6 +16,7 @@ use Tie::File; print "ok $N\n"; $N++; open F, "> $file" or die $!; +binmode F; print F $data; close F; diff --git a/lib/Tie/File/04_splice.t b/lib/Tie/File/04_splice.t index c8daf0e..aae678f 100644 --- a/lib/Tie/File/04_splice.t +++ b/lib/Tie/File/04_splice.t @@ -140,6 +140,7 @@ check_contents(""); sub init_file { my $data = shift; open F, "> $file" or die $!; + binmode F; print F $data; close F; } @@ -151,6 +152,7 @@ sub check_contents { print $integrity ? "ok $N\n" : "not ok $N\n"; $N++; my $open = open FH, "< $file"; + binmode FH; my $a; { local $/; $a = } print (($open && $a eq $x) ? "ok $N\n" : "not ok $N\n"); diff --git a/lib/Tie/File/05_size.t b/lib/Tie/File/05_size.t index 4b10858..f7a3271 100644 --- a/lib/Tie/File/05_size.t +++ b/lib/Tie/File/05_size.t @@ -16,6 +16,7 @@ print "ok $N\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"; @@ -30,6 +31,7 @@ untie @a; # 4-5 FETCHSIZE positive-length file open F, "> $file" or die $!; +binmode F; print F $data; close F; $o = tie @a, 'Tie::File', $file; @@ -65,6 +67,7 @@ sub check_contents { my $x = shift; local *FH; my $open = open FH, "< $file"; + binmode FH; my $a; { local $/; $a = } print (($open && $a eq $x) ? "ok $N\n" : "not ok $N\n"); diff --git a/lib/Tie/File/06_fixrec.t b/lib/Tie/File/06_fixrec.t index 4a8ceb8..f191921 100644 --- a/lib/Tie/File/06_fixrec.t +++ b/lib/Tie/File/06_fixrec.t @@ -23,6 +23,7 @@ sub check_contents { my $x = shift; local *FH; my $open = open FH, "< $file"; + binmode FH; my $a; { local $/; $a = } print (($open && $a eq $x) ? "ok $N\n" : "not ok $N\n"); diff --git a/lib/Tie/File/07_rv_splice.t b/lib/Tie/File/07_rv_splice.t index feaf009..aaab1f7 100644 --- a/lib/Tie/File/07_rv_splice.t +++ b/lib/Tie/File/07_rv_splice.t @@ -133,6 +133,7 @@ check_result('rec0', 'rec1'); sub init_file { my $data = shift; open F, "> $file" or die $!; + binmode F; print F $data; close F; } diff --git a/lib/Tie/File/08_ro.t b/lib/Tie/File/08_ro.t index dde7f20..2dbe239 100644 --- a/lib/Tie/File/08_ro.t +++ b/lib/Tie/File/08_ro.t @@ -30,6 +30,7 @@ for my $i (0..$#items) { sub init_file { my $data = shift; open F, "> $file" or die $!; + binmode F; print F $data; close F; } diff --git a/lib/Tie/File/09_gen_rs.t b/lib/Tie/File/09_gen_rs.t index cf79736..d5afbe1 100644 --- a/lib/Tie/File/09_gen_rs.t +++ b/lib/Tie/File/09_gen_rs.t @@ -70,6 +70,7 @@ sub check_contents { my $x = join 'blah', @c, ''; local *FH; my $open = open FH, "< $file"; + binmode FH; my $a; { local $/; $a = } print (($open && $a eq $x) ? "ok $N\n" : "not ok $N # file @c\n"); diff --git a/lib/Tie/File/10_splice_rs.t b/lib/Tie/File/10_splice_rs.t index 1e1b545..94f3d01 100644 --- a/lib/Tie/File/10_splice_rs.t +++ b/lib/Tie/File/10_splice_rs.t @@ -139,6 +139,7 @@ check_contents(""); sub init_file { my $data = shift; open F, "> $file" or die $!; + binmode F; print F $data; close F; } diff --git a/lib/Tie/File/11_rv_splice_rs.t b/lib/Tie/File/11_rv_splice_rs.t index f78c25c..654b661 100644 --- a/lib/Tie/File/11_rv_splice_rs.t +++ b/lib/Tie/File/11_rv_splice_rs.t @@ -133,6 +133,7 @@ check_result('rec0', 'rec1'); sub init_file { my $data = shift; open F, "> $file" or die $!; + binmode F; print F $data; close F; } diff --git a/lib/Tie/File/12_longfetch_rs.t b/lib/Tie/File/12_longfetch_rs.t index 60f1fd1..de40e92 100644 --- a/lib/Tie/File/12_longfetch_rs.t +++ b/lib/Tie/File/12_longfetch_rs.t @@ -16,6 +16,7 @@ use Tie::File; print "ok $N\n"; $N++; open F, "> $file" or die $!; +binmode F; print F $data; close F;