Hi,
This place is great. Thanks for the prompt replies.
So my code becomes:
open (FILEHANDLE, ">>$filepath")||&ErrorMessage;
print FILEHANDLE "$pageoutput";
close FILEHANDLE;
chmod 0666, $filepath;
Intuitively I think that is what I would have guessed but I was hoping someone would suggest a way of ammending my code in a way that included permissions in the open filehandle line.
thanks again.
Best wishes
Sid | [reply] |
Intuitively I think that is what I would have guessed but I was hoping someone would suggest a way of ammending my code in a way that included permissions in the open filehandle line.
Then, like the other poster suggested, play with umask. On my system, its default value is 2, creating plain files with permissions 0664. If you were to (temporarily) set it to 0, the file created should have permissions set to 0666. It does for me.
my $umask = umask 0;
open (FILEHANDLE, ">>$filepath")||&ErrorMessage;
umask $umask;
print FILEHANDLE "$pageoutput";
close FILEHANDLE;
| [reply] [d/l] |