Create new file in install script

I’m trying to create a new file from a install script, but I don’t seem to find the way to do it.

I think I should use open_readfile_as_domain_user, but I don’t quite know how to write the lines to the file.

How can I do it?


You can do that using “open_tempfile_as_domain_user”.

An example of that is as follows:

&open_tempfile_as_domain_user($domain, FILEHANDLE, ">$file_name"); &print_tempfile(FILEHANDLE, "Hello World"); &close_tempfile_as_domain_user($domain, FILEHANDLE);

And if this file needs to be executable from the web server

&set_permissions_as_domain_user($domain, 0755, $filename);