1#!./perl 2 3BEGIN { 4 unless(grep /blib/, @INC) { 5 chdir 't' if -d 't'; 6 @INC = '../lib'; 7 } 8} 9 10use Config; 11 12BEGIN { 13 if($ENV{PERL_CORE}) { 14 if ($Config{'extensions'} !~ /\bIO\b/) { 15 print "1..0 # Skip: IO extension not built\n"; 16 exit 0; 17 } 18 } 19 if( $^O eq 'VMS' && $Config{'vms_cc_type'} ne 'decc' ) { 20 print "1..0 # Skip: not compatible with the VAXCRTL\n"; 21 exit 0; 22 } 23} 24 25use IO::File; 26use IO::Seekable; 27 28print "1..4\n"; 29 30$x = new_tmpfile IO::File or print "not "; 31print "ok 1\n"; 32print $x "ok 2\n"; 33$x->seek(0,SEEK_SET); 34print <$x>; 35 36$x->seek(0,SEEK_SET); 37print $x "not ok 3\n"; 38$p = $x->getpos; 39print $x "ok 3\n"; 40$x->flush; 41$x->setpos($p); 42print scalar <$x>; 43 44$! = 0; 45$x->setpos(undef); 46print $! ? "ok 4 # $!\n" : "not ok 4\n"; 47 48