Does Test::MockFile help?
In reply to Re: Testing unexpected I/O failures by GrandFather in thread Testing unexpected I/O failures by kcott