8 # NOTE: we cannot use seek() here because using that *portably* would mean
9 # using Fcntl and the principle is not to use any extensions in the t/op/*
15 print "not " unless tell(TEST) == -1;
19 open(TEST, "TEST") || die "$0: failed to open 'TEST' for reading: $!\n";
21 print "not " unless tell(TEST) == 0;
26 $read = read(TEST, $s, 2);
28 $read == 2 || warn "$0: read() returned $read, expected 2\n";
29 $s eq '#!' || warn "$0: read() read '$s', expected '#!'\n";
31 print "not " unless tell(TEST) == 2;
34 print "not " unless tell() == 2;
39 print "not " unless tell($TEST) == 2;
42 close(TEST) || warn "$0: close() failed: $!\n";
46 print "not " unless tell(TEST) == -1;
50 # ftell(STDIN) (or any std streams) is undefined, it can return -1 or
51 # something else. ftell() on pipes, fifos, and sockets is defined to