split out the inside of File::transform() to avoid copying all of transform for Swift...