Another update from ingydotnet^djgoku
This commit is contained in:
parent
91df62d461
commit
948b86eafa
7604 changed files with 108452 additions and 22726 deletions
|
|
@ -1,15 +1,5 @@
|
|||
import std.stdio;
|
||||
|
||||
int main() {
|
||||
auto from = File("input.txt", "rb");
|
||||
scope(exit) from.close();
|
||||
|
||||
auto to = File("output.txt", "wb");
|
||||
scope(exit) to.close();
|
||||
|
||||
foreach(buffer; from.byChunk(new ubyte[4096*1024])) {
|
||||
to.rawWrite(buffer);
|
||||
}
|
||||
|
||||
return 0;
|
||||
void main() {
|
||||
import std.file;
|
||||
auto data = std.file.read("input.txt");
|
||||
std.file.write("output.txt", data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,15 @@
|
|||
import tango.io.device.File;
|
||||
import std.stdio;
|
||||
|
||||
void main()
|
||||
{
|
||||
auto from = new File("input.txt");
|
||||
auto to = new File("output.txt", File.WriteCreate);
|
||||
to.copy(from).close;
|
||||
from.close;
|
||||
int main() {
|
||||
auto from = File("input.txt", "rb");
|
||||
scope(exit) from.close();
|
||||
|
||||
auto to = File("output.txt", "wb");
|
||||
scope(exit) to.close();
|
||||
|
||||
foreach(buffer; from.byChunk(new ubyte[4096*1024])) {
|
||||
to.rawWrite(buffer);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ import tango.io.device.File;
|
|||
|
||||
void main()
|
||||
{
|
||||
auto from = new File("input.txt");
|
||||
auto to = new File("output.txt", File.WriteCreate);
|
||||
to.copy(new File("input.txt")).close;
|
||||
to.copy(from).close;
|
||||
from.close;
|
||||
}
|
||||
|
|
|
|||
7
Task/File-input-output/D/file-input-output-5.d
Normal file
7
Task/File-input-output/D/file-input-output-5.d
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import tango.io.device.File;
|
||||
|
||||
void main()
|
||||
{
|
||||
auto to = new File("output.txt", File.WriteCreate);
|
||||
to.copy(new File("input.txt")).close;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue