Files
ldc/tango/example/conduits/filecat.d
Tomas Lindquist Olsen b15b3484c8 [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.
2008-01-11 17:57:40 +01:00

27 lines
782 B
D

private import tango.io.Console,
tango.io.FileConduit;
/*******************************************************************************
Concatenate a number of files onto a single destination
*******************************************************************************/
void main(char[][] args)
{
if (args.length > 2)
{
// open the file for writing
auto dst = new FileConduit (args[1], FileConduit.WriteCreate);
// copy each file onto dst
foreach (char[] arg; args[2..args.length])
dst.copy (new FileConduit(arg));
// flush output and close
dst.close;
}
else
Cout ("usage: filecat target source1 ... sourceN");
}