[vox-tech] perl question -- running a bash built-in

Michael Wenk vox-tech@lists.lugod.org
Thu, 5 Dec 2002 14:25:39 -0800


Got beat on replying to this.  Also, the best way to get help on an
individual function is with the perldoc -f <func>.  Obviously that's my
opinion but it has served me well....

Mike

----- Original Message -----
From: <msimons@moria.simons-clan.com>
To: <vox-tech@lists.lugod.org>
Sent: Thursday, December 05, 2002 12:37 PM
Subject: Re: [vox-tech] perl question -- running a bash built-in


> On Thu, Dec 05, 2002 at 12:26:57PM -0800, Peter Jay Salzman wrote:
> > how do i get at the value of umask from within a perl script?   since
> > umask is bult into bash, i can't do something like:
> >
> > my $umask = `umask`;
>
>   not an environment variable.
>
>   umask is a process trait, which is inherited by fork.  there is a system
> call call "mode_t umask(mode_t mask)", for changing it, see some more in
> man 2 umask.
>
>   to muck with umask in perl there is a function, umask.
>        umask EXPR
>        umask   Sets the umask for the process to EXPR and returns
>                the previous value.  If EXPR is omitted, merely
>                returns the current umask.
> for more see man perlfunc, search for '  umask '...
>
>    Later,
>      Mike
>
> ps:
>   had umask been an env variable it would have been adjusted by mucking
with
> the ENV has...
>   $ENV{'umask'} = "0644';
> see more in man perlvar
> _______________________________________________
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech