The behavior of water confined near nonpolar surfaces has important implications for a number of biological phenomena. In this type of confined environment the properties of "hydrophobicity" and "hydrophilicity" are closely related to the structure of the interfacial water, which in turn can depend on temperature in a very subtle way. Although the physical-chemical consequences of this fact have been theoretically addressed to a great extent, the underlying thermodynamic question is still widely discussed. Accordingly we performed thermogravimetric analysis and variable-temperature powder X-ray diffraction studies on representative hydrogen bonding organic pores occupied by water. The results indicate that a hydrophilic-to-hydrophobic transition of the inner surface of the pores occurs upon increasing temperature, which may be attributed to a strong influence of the dynamics and thermodynamics of local water molecules on the surface affinity of the pores. The relevance of our findings to the understanding of the phenomenon of water transport in natural pores is discussed.