rigsby
asked on
File Permissions
I am running Perl on an AIX box and have written a script that automatically creates a file should the file be removed / deleted etc. However when the file is created it inherits only the read / write permissions of the user who ran the script at that time.
Is there any way I can overide this and set global permissions to this file as everyone uses the script?????
Is there any way I can overide this and set global permissions to this file as everyone uses the script?????
If you want to avoid launching an external process you can use the perl command "chmod" like so:
chmod(0775,"$yourfile1","y ourfile2") ;
chmod(0775,"$yourfile1","y
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
see also: umask
you can embed the following command in you PERL script right after you have closed the file
$yourfile="/tmp/file.txt";
open(FILE,">file.txt") || die $!;
###Do some file write...
close(FILE);
`chmod 775 $yourfile`;