We are using FakeFS for file functions in our spec tests.  Can you do a quick re-write with that?