These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for Create new file in install script on the new forum.
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?
Howdy,
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);