file: Support writing of multiple segments.