summaryrefslogtreecommitdiff
path: root/t/op.stat
diff options
context:
space:
mode:
Diffstat (limited to 't/op.stat')
-rw-r--r--t/op.stat29
1 files changed, 29 insertions, 0 deletions
diff --git a/t/op.stat b/t/op.stat
new file mode 100644
index 0000000000..c087c2484e
--- /dev/null
+++ b/t/op.stat
@@ -0,0 +1,29 @@
+#!./perl
+
+# $Header: op.stat,v 1.0 87/12/18 13:14:27 root Exp $
+
+print "1..4\n";
+
+open(foo, ">Op.stat.tmp");
+
+($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
+ $blksize,$blocks) = stat(foo);
+if ($nlink == 1) {print "ok 1\n";} else {print "not ok 1\n";}
+if ($mtime && $mtime == $ctime) {print "ok 2\n";} else {print "not ok 2\n";}
+
+print foo "Now is the time for all good men to come to.\n";
+close(foo);
+
+$base = time;
+while (time == $base) {}
+
+`rm -f Op.stat.tmp2; ln Op.stat.tmp Op.stat.tmp2; chmod 644 Op.stat.tmp`;
+
+($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
+ $blksize,$blocks) = stat('Op.stat.tmp');
+
+if ($nlink == 2) {print "ok 3\n";} else {print "not ok 3\n";}
+if ($mtime && $mtime != $ctime) {print "ok 4\n";} else {print "not ok 4\n";}
+print "#4 :$mtime: != :$ctime:\n";
+
+`rm -f Op.stat.tmp Op.stat.tmp2`;