read/write for nonleaf/leaf nodes given a pf, pid