* Do not remove any of the existing code. It has been kept there keeping in mind about future development extending support of the existing functionality. You've removed couple of lines in the sysSettings::GetConfigFile(...) function, which is not good.
In your code:
* Checked only for PGPASSFILE environment variable.
* Need to check the existence of the file. * Take required actions (if that file/parent directory does not exists).