Change some fileutils methods to use new-style exceptions