write segment file to stdout