Ken Lehman wrote:
>
> Is it possible to open/create a file with open that does not exist and give
> it a umask that makes it executable, say for the purpose of generating shell
> scripts?
Yes.
> For example, say
>
> open OUT_FILE, MAGIC_UMASK, "/scripts/new_script";
>
> where the current umask is 2.
> Is the only option to chmod the file after it has been created?
use Fcntl;
umask( 022 );
sysopen( OUT_FILE, '/scripts/new_script', O_WRONLY | O_EXCL | O_CREAT,
0777 )
or die "Cannot open '/scripts/new_script' $!";
perldoc -f sysopen
perldoc -f open
perldoc perlopentut
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]