fname = prompt("filename");

f = new File(fname);
if(!f.open("r")) {
	alert("Error opening file");
	exit();
}
out = new File("/test.txt");

if(!out.open("w")) {
	alert("Error creating file");
	exit();
}

text = f.readAll();
for(line in text) 
	out.writeln(text[line]);
f.close();
out.close();
