perl 1.0 patch 1: Portability bugs and one possible SIGSEGV
[p5sagit/p5-mst-13.2.git] / t / op.stat
CommitLineData
8d063cd8 1#!./perl
2
3# $Header: op.stat,v 1.0 87/12/18 13:14:27 root Exp $
4
5print "1..4\n";
6
7open(foo, ">Op.stat.tmp");
8
9($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
10 $blksize,$blocks) = stat(foo);
11if ($nlink == 1) {print "ok 1\n";} else {print "not ok 1\n";}
12if ($mtime && $mtime == $ctime) {print "ok 2\n";} else {print "not ok 2\n";}
13
14print foo "Now is the time for all good men to come to.\n";
15close(foo);
16
17$base = time;
18while (time == $base) {}
19
20`rm -f Op.stat.tmp2; ln Op.stat.tmp Op.stat.tmp2; chmod 644 Op.stat.tmp`;
21
22($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
23 $blksize,$blocks) = stat('Op.stat.tmp');
24
25if ($nlink == 2) {print "ok 3\n";} else {print "not ok 3\n";}
26if ($mtime && $mtime != $ctime) {print "ok 4\n";} else {print "not ok 4\n";}
27print "#4 :$mtime: != :$ctime:\n";
28
29`rm -f Op.stat.tmp Op.stat.tmp2`;