3 # There are few filetest operators that are portable enough to test.
4 # See pod/perlport.pod for details.
14 print "not " unless -d 'op';
17 print "not " unless -f 'TEST';
20 print "not " if -f 'op';
23 print "not " if -d 'TEST';
26 print "not " unless -r 'TEST';
29 # make sure TEST is r-x
30 eval { chmod 0555, 'TEST' };
33 $oldeuid = $>; # root can read and write anything
34 eval '$> = 1'; # so switch uid (may not be implemented)
36 print "# oldeuid = $oldeuid, euid = $>\n";
38 if (!$Config{d_seteuid}) {
39 print "ok 6 #skipped, no seteuid\n";
42 print "#[$@]\nok 6 #skipped\n";
45 print "not " if -w 'TEST';
49 # Scripts are not -x everywhere so cannot test that.
51 eval '$> = $oldeuid'; # switch uid back (may not be implemented)
53 # this would fail for the euid 1
54 # (unless we have unpacked the source code as uid 1...)
55 print "not " unless -r 'op';
58 # this would fail for the euid 1
59 # (unless we have unpacked the source code as uid 1...)
60 if ($Config{d_seteuid}) {
61 print "not " unless -w 'op';
64 print "ok 8 #skipped, no seteuid\n";
67 print "not " unless -x 'op'; # Hohum. Are directories -x everywhere?
70 print "not " unless "@{[grep -r, qw(foo io noo op zoo)]}" eq "io op";