def is_libdir_writable(self):
        dir = self.call_pg_config('libdir')
        logger.debug("testing if %s is writable", dir)
        try:
            f = tempfile.TemporaryFile(prefix="pgxn-", suffix=".test", dir=dir)
            f.write(b('test'))
            f.close()
        except (IOError, OSError):
            rv = False
        else:
            rv = True

        return rv
Check if the Postgres installation directory is writable.
dataset/ETHPy150Open dvarrazzo/pgxnclient/pgxnclient/commands/install.py/SudoInstallUninstall.is_libdir_writable