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";
41 elsif ($Config{config_args} =~/Dmksymlinks/) {
42 print "ok 6 #skipped, we cannot chmod symlinks\n";
45 print "#[$@]\nok 6 #skipped\n";
48 print "not " if -w 'TEST';
52 # Scripts are not -x everywhere so cannot test that.
54 eval '$> = $oldeuid'; # switch uid back (may not be implemented)
56 # this would fail for the euid 1
57 # (unless we have unpacked the source code as uid 1...)
58 print "not " unless -r 'op';
61 # this would fail for the euid 1
62 # (unless we have unpacked the source code as uid 1...)
63 if ($Config{d_seteuid}) {
64 print "not " unless -w 'op';
67 print "ok 8 #skipped, no seteuid\n";
70 print "not " unless -x 'op'; # Hohum. Are directories -x everywhere?
73 print "not " unless "@{[grep -r, qw(foo io noo op zoo)]}" eq "io op";