Mercurial > projects > ldc
comparison tango/example/conduits/filecat.d @ 132:1700239cab2e trunk
[svn r136] MAJOR UNSTABLE UPDATE!!!
Initial commit after moving to Tango instead of Phobos.
Lots of bugfixes...
This build is not suitable for most things.
author | lindquist |
---|---|
date | Fri, 11 Jan 2008 17:57:40 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:5825d48b27d1 | 132:1700239cab2e |
---|---|
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 } |