xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/lib/File/Path.t (revision 0:68f95e015346)
1*0Sstevel@tonic-gate#!./perl -wT
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gateBEGIN {
4*0Sstevel@tonic-gate    chdir 't' if -d 't';
5*0Sstevel@tonic-gate    @INC = '../lib';
6*0Sstevel@tonic-gate}
7*0Sstevel@tonic-gate
8*0Sstevel@tonic-gateuse File::Path;
9*0Sstevel@tonic-gateuse File::Spec::Functions;
10*0Sstevel@tonic-gateuse strict;
11*0Sstevel@tonic-gate
12*0Sstevel@tonic-gatemy $count = 0;
13*0Sstevel@tonic-gateuse warnings;
14*0Sstevel@tonic-gate
15*0Sstevel@tonic-gateprint "1..4\n";
16*0Sstevel@tonic-gate
17*0Sstevel@tonic-gate# first check for stupid permissions second for full, so we clean up
18*0Sstevel@tonic-gate# behind ourselves
19*0Sstevel@tonic-gatefor my $perm (0111,0777) {
20*0Sstevel@tonic-gate    my $path = catdir(curdir(), "mhx", "bar");
21*0Sstevel@tonic-gate    mkpath($path);
22*0Sstevel@tonic-gate    chmod $perm, "mhx", $path;
23*0Sstevel@tonic-gate
24*0Sstevel@tonic-gate    print "not " unless -d "mhx" && -d $path;
25*0Sstevel@tonic-gate    print "ok ", ++$count, "\n";
26*0Sstevel@tonic-gate
27*0Sstevel@tonic-gate    rmtree("mhx");
28*0Sstevel@tonic-gate    print "not " if -e "mhx";
29*0Sstevel@tonic-gate    print "ok ", ++$count, "\n";
30*0Sstevel@tonic-gate}
31