H
Hon Guin Lee - Web Producer - SMI Marketing
My objective is to open a file if it exists, and if not create a new file from the string variable $FILE, but I have encountered a problem that in some occurences the file can be opened and modified without the compiler throwing error messages otherwise it throws a Permission Denied error (not owner) from just modifying a file within the local web server.
# open the file and allow it to be modified.
# modify file by adding the content or create a new file.
open($FILE, "> $page") || die $!;
sysopen($FILE, $page, O_WRONLY|O_CREAT) || die $!;
sysopen($FILE, $page, O_WRONLY|O_CREAT, 0777) || die $!;
OR
sysopen($FILE, $page, O_WRONLY | O_CREAT, 0777) || die $!;
# open the file and allow it to be modified.
# modify file by adding the content or create a new file.
open($FILE, "> $page") || die $!;
sysopen($FILE, $page, O_WRONLY|O_CREAT) || die $!;
sysopen($FILE, $page, O_WRONLY|O_CREAT, 0777) || die $!;
OR
sysopen($FILE, $page, O_WRONLY | O_CREAT, 0777) || die $!;