From: Charles Bailey Date: Tue, 26 Nov 1996 22:28:23 +0000 (-0500) Subject: Re: updated patch on the sysread, syswrite for VMS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9fcfb7d3fd98112237a529ff1b3b6bc885c416a0;p=p5sagit%2Fp5-mst-13.2.git 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> --- diff --git a/t/op/sysio.t b/t/op/sysio.t index 94a29c1..554fdf5 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";