diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-22 10:53:06 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-22 10:53:06 +0000 |
commit | 2f3b6ae408a2d23f3c90b00b9fbaa2ad4c9a755a (patch) | |
tree | fcadde88e0cff324438491ab42fb917befd622c7 /t | |
parent | f89480d452d435e4e828b4920af70120508474bb (diff) | |
download | perl-2f3b6ae408a2d23f3c90b00b9fbaa2ad4c9a755a.tar.gz |
truncate(FH) flushes FH before truncating it
p4raw-id: //depot/perl@4838
Diffstat (limited to 't')
-rwxr-xr-x | t/io/fs.t | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -152,11 +152,12 @@ else { truncate "Iofs.tmp", 0; if (-z "Iofs.tmp") {print "ok 24\n"} else {print "not ok 24\n"} open(FH, ">Iofs.tmp") or die "Can't create Iofs.tmp"; + binmode FH; { select FH; $| = 1; select STDOUT } { use strict; - print FH "helloworld\n"; - truncate FH, 5; + print FH "x\n" x 200; + truncate(FH, 200) or die "Can't truncate FH: $!"; } if ($^O eq 'dos' # Not needed on HPFS, but needed on HPFS386 ?! @@ -164,7 +165,7 @@ else { { close (FH); open (FH, ">>Iofs.tmp") or die "Can't reopen Iofs.tmp"; } - if (-s "Iofs.tmp" == 5) {print "ok 25\n"} else {print "not ok 25\n"} + if (-s "Iofs.tmp" == 200) {print "ok 25\n"} else {print "not ok 25\n"} truncate FH, 0; if ($^O eq 'dos' # Not needed on HPFS, but needed on HPFS386 ?! |