diff options
author | Abhijit Menon-Sen <ams@wiw.org> | 2002-03-01 03:03:12 +0000 |
---|---|---|
committer | Abhijit Menon-Sen <ams@wiw.org> | 2002-03-01 03:03:12 +0000 |
commit | 1768807ea66f86a1167ded3f0eee840431c881b6 (patch) | |
tree | ee36245d065b536cf974551fc5d2123e2b1f1fbd /lib/Tie | |
parent | b5aed31e70f740da725963bb498bc888bb8620b1 (diff) | |
download | perl-1768807ea66f86a1167ded3f0eee840431c881b6.tar.gz |
Upgrade to Tie::File 0.13 (Win32 fixes.)
p4raw-id: //depot/perl@14919
Diffstat (limited to 'lib/Tie')
-rw-r--r-- | lib/Tie/File.pm | 9 | ||||
-rw-r--r-- | lib/Tie/File/02_fetchsize.t | 1 | ||||
-rw-r--r-- | lib/Tie/File/03_longfetch.t | 1 | ||||
-rw-r--r-- | lib/Tie/File/04_splice.t | 2 | ||||
-rw-r--r-- | lib/Tie/File/05_size.t | 3 | ||||
-rw-r--r-- | lib/Tie/File/06_fixrec.t | 1 | ||||
-rw-r--r-- | lib/Tie/File/07_rv_splice.t | 1 | ||||
-rw-r--r-- | lib/Tie/File/08_ro.t | 1 | ||||
-rw-r--r-- | lib/Tie/File/09_gen_rs.t | 1 | ||||
-rw-r--r-- | lib/Tie/File/10_splice_rs.t | 1 | ||||
-rw-r--r-- | lib/Tie/File/11_rv_splice_rs.t | 1 | ||||
-rw-r--r-- | lib/Tie/File/12_longfetch_rs.t | 1 |
12 files changed, 19 insertions, 4 deletions
diff --git a/lib/Tie/File.pm b/lib/Tie/File.pm index 5b9381b6c5..2b6c9a5db3 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<mjd-perl-tiefile-subscribe@plover.com>. =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 @@ -717,7 +718,7 @@ For licensing inquiries, contact the author at: =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 diff --git a/lib/Tie/File/02_fetchsize.t b/lib/Tie/File/02_fetchsize.t index aaf44f09c7..b7ea3a5dbc 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 7e36962e9b..83f011ef82 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 c8daf0e9e3..aae678f664 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 = <FH> } 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 4b1085876f..f7a327141e 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 = <FH> } 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 4a8ceb8d55..f191921f36 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 = <FH> } 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 feaf0096bf..aaab1f7d6b 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 dde7f20f14..2dbe2397e4 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 cf797360e5..d5afbe177d 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 = <FH> } 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 1e1b545ccd..94f3d01539 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 f78c25c8d8..654b661e8d 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 60f1fd1a50..de40e923c6 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; |