D语言读写文件的操作(原创)
import std.stream;
import std.stdio;
void main () {
?File file = new File ;
?File OutFile = new File;?
?try {
? file.open("1.srt",FileMode.In);
? OutFile.open("out.srt", FileMode.Out);
? while(!file.eof()) {
? ? char[] str=file.readLine();
? ? OutFile.writeLine(str);
??? //printf("%.*s\n",file.readLine());
? }
?}
?catch (Exception x) {
? writefln("Datei kann nicht geoeffnet werden ");
? throw x;
?}
?OutFile.close();
?file.close();
?}