Add a file permission option.

Allow the user to pass an optional filepermissions octal parameter to the file consumer, which will be used instead of 0777 on the chmod().