C extension to open and r/w to files