Added ability to specify file permissions