a "replacement" for awk and sed
[p5sagit/p5-mst-13.2.git] / t / op.stat
1 #!./perl
2
3 # $Header: op.stat,v 1.0 87/12/18 13:14:27 root Exp $
4
5 print "1..4\n";
6
7 open(foo, ">Op.stat.tmp");
8
9 ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
10     $blksize,$blocks) = stat(foo);
11 if ($nlink == 1) {print "ok 1\n";} else {print "not ok 1\n";}
12 if ($mtime && $mtime == $ctime) {print "ok 2\n";} else {print "not ok 2\n";}
13
14 print foo "Now is the time for all good men to come to.\n";
15 close(foo);
16
17 $base = time;
18 while (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
25 if ($nlink == 2) {print "ok 3\n";} else {print "not ok 3\n";}
26 if ($mtime && $mtime != $ctime) {print "ok 4\n";} else {print "not ok 4\n";}
27 print "#4       :$mtime: != :$ctime:\n";
28
29 `rm -f Op.stat.tmp Op.stat.tmp2`;