summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU>1996-11-26 17:28:23 -0500
committerChip Salzenberg <chip@atlantic.net>1996-11-30 05:31:00 +1200
commit9fcfb7d3fd98112237a529ff1b3b6bc885c416a0 (patch)
treeff97b457108733f23544c8fe7d689837ec78205b
parentb739d68ac13dadf36db54b3ac9892909c39a3ccf (diff)
downloadperl-9fcfb7d3fd98112237a529ff1b3b6bc885c416a0.tar.gz
Re: updated patch on the sysread, syswrite for VMS
Subject: Re: updated patch on the sysread, syswrite > Based on feedback I got, here is an updated patch. I would appreciate > even more feedback as I added a t/op test that exercises the sysread, > syswrite. Especially appreciated experiences on non-UNIX systems like > OS/2, VMS, we'll see how portable my very UNIXish ideas of what those > two calls should do are... to be applied on top of 3_08. Looks OK under VMS. Appended is a patch to the test, which works around the fact that file size as returned by -s isn't updated until a file is closed. p5p-msgid: <01ICB648K2XG001A1D@hmivax.humgen.upenn.edu>
-rwxr-xr-xt/op/sysio.t17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/op/sysio.t b/t/op/sysio.t
index 94a29c16b9..554fdf5b0a 100755
--- a/t/op/sysio.t
+++ b/t/op/sysio.t
@@ -6,6 +6,8 @@ chdir('op') || die "sysio.t: cannot look for myself: $!";
open(I, 'sysio.t') || die "sysio.t: cannot find myself: $!";
+$reopen = ($^O eq 'VMS' || $^O eq 'os2');
+
$x = 'abc';
# should not be able to do negative lengths
@@ -81,6 +83,9 @@ print 'not ' unless ($x eq 'abc');
print "ok 15\n";
# $outfile still intact
+if ($reopen) { # must close file to update EOF marker for stat
+ close O; open(O, ">>$outfile") || die "sysio.t: cannot write $outfile: $!";
+}
print 'not ' if (-s $outfile);
print "ok 16\n";
@@ -95,6 +100,9 @@ print 'not ' unless ($x eq 'abc');
print "ok 18\n";
# $outfile still intact
+if ($reopen) { # must close file to update EOF marker for stat
+ close O; open(O, ">>$outfile") || die "sysio.t: cannot write $outfile: $!";
+}
print 'not ' if (-s $outfile);
print "ok 19\n";
@@ -107,6 +115,9 @@ print 'not ' unless ($a eq "#!.\0\0erl");
print "ok 21\n";
# $outfile should have grown now
+if ($reopen) { # must close file to update EOF marker for stat
+ close O; open(O, ">>$outfile") || die "sysio.t: cannot write $outfile: $!";
+}
print 'not ' unless (-s $outfile == 2);
print "ok 22\n";
@@ -119,6 +130,9 @@ print 'not ' unless ($a eq "#!.\0\0erl");
print "ok 24\n";
# $outfile should have grown now
+if ($reopen) { # must close file to update EOF marker for stat
+ close O; open(O, ">>$outfile") || die "sysio.t: cannot write $outfile: $!";
+}
print 'not ' unless (-s $outfile == 4);
print "ok 25\n";
@@ -131,6 +145,9 @@ print 'not ' unless ($a eq "#!.\0\0erl");
print "ok 27\n";
# $outfile should have grown now
+if ($reopen) { # must close file to update EOF marker for stat
+ close O; open(O, ">>$outfile") || die "sysio.t: cannot write $outfile: $!";
+}
print 'not ' unless (-s $outfile == 7);
print "ok 28\n";