in reply to mkdir with variable mask
Well, I think, you could consider to use chmod directly after successful creation of the new directory.
untested quickshot of my thoughts:
#! /usr/bin/perl use strict; use warnings; # added: use File::Spec::Functions qw( catdir ); my $dir = '/home/me/perl-stuff/"; my $mode = (stat $dir)[2]; # better use File::Spec::catfile #$dir .= 'testdir'; $dir = catdir( $dir, 'testdir' ); mkdir( $dir, $mode ) or die "$!\n"; # update2: $mode added chmod( $mode, $dir ) or die "$!\n";
updates
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: mkdir with variable mask
by kreetrapper (Scribe) on Jan 26, 2009 at 14:44 UTC | |
by ikegami (Patriarch) on Jan 26, 2009 at 14:55 UTC | |
by MidLifeXis (Monsignor) on Jan 26, 2009 at 15:29 UTC | |
by ikegami (Patriarch) on Jan 26, 2009 at 17:45 UTC | |
by MidLifeXis (Monsignor) on Jan 26, 2009 at 18:05 UTC |