132
|
1 private import tango.io.Console,
|
|
2 tango.io.FileConduit;
|
|
3
|
|
4 /*******************************************************************************
|
|
5
|
|
6 Concatenate a number of files onto a single destination
|
|
7
|
|
8 *******************************************************************************/
|
|
9
|
|
10 void main(char[][] args)
|
|
11 {
|
|
12 if (args.length > 2)
|
|
13 {
|
|
14 // open the file for writing
|
|
15 auto dst = new FileConduit (args[1], FileConduit.WriteCreate);
|
|
16
|
|
17 // copy each file onto dst
|
|
18 foreach (char[] arg; args[2..args.length])
|
|
19 dst.copy (new FileConduit(arg));
|
|
20
|
|
21 // flush output and close
|
|
22 dst.close;
|
|
23 }
|
|
24 else
|
|
25 Cout ("usage: filecat target source1 ... sourceN");
|
|
26 }
|