mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-13 11:23:14 +01:00
Initial commit after moving to Tango instead of Phobos. Lots of bugfixes... This build is not suitable for most things.
27 lines
782 B
D
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");
|
|
}
|