fix read/write; add seek