132
|
1
|
|
2 private import tango.io.Console,
|
|
3 tango.io.FileConduit;
|
|
4
|
|
5 /*******************************************************************************
|
|
6
|
|
7 open a file, and stream directly to console
|
|
8
|
|
9 *******************************************************************************/
|
|
10
|
|
11 void main (char[][] args)
|
|
12 {
|
|
13 if (args.length is 2)
|
|
14 {
|
|
15 // open a file for reading
|
|
16 auto fc = new FileConduit (args[1]);
|
|
17
|
|
18 // stream directly to console
|
|
19 Cout.stream.copy (fc);
|
|
20 }
|
|
21 else
|
|
22 Cout ("usage is: filecopy filename").newline;
|
|
23 }
|