Hi, I'm confused on the correct way to set permissions to files/directories in a script. With windows, it's a no-brainer, but on a Debian/Linux server, I try to set permissions (automatically) from within the script like this and it won't work.
...is this why it doesn't accept the proper permissions? Should I set the permissions to something else? If I directly create this blank file and set the permissions to 0666, I have no problems. Can anyone set the record straight for me?
Thanks,
Code:
if (!open(FH, $file)) {
open(FH, ">$file") || die $!;
chmod(0666, $file) || die $!;
close(FH) || die $!;
}
Thanks,