Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

        Concatenate a number of files onto a single destination


private import,

void main(char[][] args)
        if (args.length > 2)
           // open the file for writing
           auto dst = new File (args[1], File.WriteCreate);

           // copy each file onto dst
           foreach (arg; args[2..args.length])
                    dst.copy (new File(arg));

           // flush output and close
           Cout ("usage: filecat target source1 ... sourceN").newline;