+unlink "Op.stat.tmp";
+if (open(FOO, ">Op.stat.tmp")) {
+ # hack to make Apollo update link count:
+ $junk = `ls Op.stat.tmp` unless ($Is_MSWin32 || $Is_Dos);
+
+ ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
+ $blksize,$blocks) = stat(FOO);
+ if ($nlink == 1) {
+ print "ok 1\n";
+ }
+ else {
+ print "# res=$res, nlink=$nlink.\nnot ok 1\n";
+ }
+ if ($Is_MSWin32 or $Is_Cygwin or $Is_Dos || ($mtime && $mtime == $ctime)) {
+ print "ok 2\n";
+ }
+ else {
+ print "# |$mtime| vs |$ctime|\nnot ok 2\n";
+ }
+
+ my $funky_FAT_timestamps = $Is_Cygwin;
+
+ sleep 3 if $funky_FAT_timestamps;
+
+ print FOO "Now is the time for all good men to come to.\n";
+ close(FOO);
+
+ sleep 2 unless $funky_FAT_timestamps;
+
+} else {
+ print "# open failed: $!\nnot ok 1\nnot ok 2\n";
+}