1N/A#!./perl
1N/A
1N/A# $RCSfile: read.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:17 $
1N/A
1N/Aprint "1..4\n";
1N/A
1N/A
1N/Aopen(FOO,'op/read.t') || open(FOO,'t/op/read.t') || open(FOO,':op:read.t') || die "Can't open op.read";
1N/Aseek(FOO,4,0);
1N/A$got = read(FOO,$buf,4);
1N/A
1N/Aprint ($got == 4 ? "ok 1\n" : "not ok 1\n");
1N/Aprint ($buf eq "perl" ? "ok 2\n" : "not ok 2 :$buf:\n");
1N/A
1N/Aseek (FOO,0,2) || seek(FOO,20000,0);
1N/A$got = read(FOO,$buf,4);
1N/A
1N/Aprint ($got == 0 ? "ok 3\n" : "not ok 3\n");
1N/Aprint ($buf eq "" ? "ok 4\n" : "not ok 4\n");