132
|
1 /*****************************************************
|
|
2
|
|
3 Example that shows some simple file operations
|
|
4
|
|
5 Put into public domain by Lars Ivar Igesund
|
|
6
|
|
7 *****************************************************/
|
|
8
|
|
9 import tango.io.Stdout;
|
|
10
|
|
11 import tango.io.FilePath;
|
|
12
|
|
13 void main (char[][] args)
|
|
14 {
|
|
15 auto src = args[0] ~ ".d";
|
|
16 auto dst = new FilePath (args[0] ~ ".d.copy");
|
|
17
|
|
18 Stdout.formatln ("copy file {} to {}", src, dst);
|
|
19 dst.copy (src);
|
|
20 assert (dst.exists);
|
|
21
|
|
22 Stdout.formatln ("removing file {}", dst);
|
|
23 dst.remove;
|
|
24
|
|
25 assert (dst.exists is false);
|
|
26 }
|