add PGD file support.
add pgd_close, match with pgd_open
Merge pull request #781 from tpunix/master

PGD file support