How to reliably set file/folder permissions?

FS_CHMOD_FILE and FS_CHMOD_DIR are applicable only if both of the following criteria are satisfied …

  • the host allows the change in permissions (for an explanation on this, please see https://superuser.com/a/767261 )
  • the files are created by WordPress (such as WordPress core updates / upgrades, plugin installations / updates, theme installations / updates, or user uploaded media via example.com/wp-admin/media-new.php or using new post / page, etc)

So, considering the above criteria, the following statements are true…

  • permissions of existing files and folders are not modified (by WordPress) just because FS_CHMOD_FILE and FS_CHMOD_DIR are set now!
  • permissions of files that are created / uploaded via FTP/SFTP/SCP/rsync are not modified by WordPress, even after FS_CHMOD_FILE and FS_CHMOD_DIR are set.

I hope this clarifies about your following concerns…

Having done this… why then, when using an ftp app to view the
permissions of a file, are they shown as different?

For example, by ftp I set wp-config.php to 600 before modifying it –
and by ftp it still appears to be 600 rather than the 644 set in
wp-config.php.