3 # There are few filetest operators that are portable enough to test.
4 # See pod/perlport.pod for details.
12 print "not " unless -d 'op';
15 print "not " unless -f 'TEST';
18 print "not " if -f 'op';
21 print "not " if -d 'TEST';
24 print "not " unless -r 'TEST';
27 # make sure TEST is r-x
28 eval { chmod 0555, 'TEST' };
31 $oldeuid = $>; # root can read and write anything
32 eval '$> = 1'; # so switch uid (may not be implemented)
34 print "# oldeuid = $oldeuid, euid = $>\n";
37 print "#[$@]\nok 6 #skipped\n";
40 print "not " if -w 'TEST';
44 # Scripts are not -x everywhere so cannot test that.
46 print "not " unless -r 'op';
49 eval '$> = $oldeuid'; # switch uid back (may not be implemented)
51 # this would fail for the euid 1
52 # (unless we have unpacked the source code as uid 1...)
53 print "not " unless -w 'op';
56 print "not " unless -x 'op'; # Hohum. Are directories -x everywhere?
59 print "not " unless "@{[grep -r, qw(foo io noo op zoo)]}" eq "io op";