in reply to mkpath()
You need the heading 0 to make sure perl knows that you're giving it an octal valuemkpath("/var/tmp/log/script/",0,01777);
sub my_mkpath { my ($path, $mask) = @_; my $ok = 1; my $save_u = umask(); umask(0); eval(mkpath($path, 0, oct($mask))); if($@) # mkpath failed! {warn "Couldn't create $path: $@"; $ok=0;} umask($save_u); return $ok; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: mkpath()
by Anonymous Monk on Apr 17, 2003 at 14:31 UTC | |
|
Re: Re: mkpath()
by Anonymous Monk on Apr 17, 2003 at 14:58 UTC | |
|
Re: Re: mkpath()
by demerphq (Chancellor) on Apr 17, 2003 at 17:40 UTC |