10 eval { my @n = stat "TEST" };
11 $hasst = 1 unless $@ && $@ =~ /unimplemented/;
12 unless ($hasst) { print "1..0 # Skip: no stat\n"; exit 0 }
14 $hasst = 0 unless $Config{'i_sysstat'} eq 'define';
15 unless ($hasst) { print "1..0 # Skip: no sys/stat.h\n"; exit 0 }
19 our @stat = stat "TEST"; # This is the function stat.
20 unless (@stat) { print "1..0 # Skip: no file TEST\n"; exit 0 }
29 my $stat = stat "TEST"; # This is the OO stat.
31 print "not " unless $stat->dev == $stat[ 0];
34 # On OS/2 (fake) ino is not constant, it is incremented each time
35 print "# ino=>@{[$stat->ino]}, 1=>$stat[ 1]\nnot "
36 unless $stat->ino == $stat[ 1] or $^O eq 'os2';
39 print "not " unless $stat->mode == $stat[ 2];
42 print "not " unless $stat->nlink == $stat[ 3];
45 print "not " unless $stat->uid == $stat[ 4];
48 print "not " unless $stat->gid == $stat[ 5];
51 print "not " unless $stat->rdev == $stat[ 6];
54 print "not " unless $stat->size == $stat[ 7];
57 print "not " unless $stat->atime == $stat[ 8];
60 print "not " unless $stat->mtime == $stat[ 9];
63 print "not " unless $stat->ctime == $stat[10];
66 print "not " unless $stat->blksize == $stat[11];
69 print "not " unless $stat->blocks == $stat[12];
72 # Testing pretty much anything else is unportable.