I added 2 changes:
1 - Creation of a global mustSetPermissions that receives 1 only when save_restoreSet_FilePermissions is used. Otherwise, it is maintained in 0 in a way that fchmod is called only when the user wants to set file permissions to SAV files.
2 - Creation of a function to print a human readable error message when fchmod fails to execute.
I added 2 changes: 1 - Creation of a global mustSetPermissions that receives 1 only when save_restoreSet_FilePermissions is used. Otherwise, it is maintained in 0 in a way that fchmod is called only when the user wants to set file permissions to SAV files. 2 - Creation of a function to print a human readable error message when fchmod fails to execute.