Revert "Merge pull request #37 from kazupon/fix/files-output"

This reverts commit ac83827d9efdee0b74af17d59aad87939c2283f8, reversing
changes made to f366a615f54e5baf307ff6eead8d0f1de4a398db.
fix local file rewriting

not exactly sure what the test case is for this…