drop unnecessary fgetattr()
change default file permissions to 0644