Der Purpurrote Krieger: Kopieren

Beitrag lesen

Habe es nun so gelöst.

  
	try{  
  
		    File inputFile = new File  
		    ("C:\\xxx\\xxx\\xxx\\test1.txt");  
		    File outputFile = new File  
		    ("N:\\Projekte\\xxx\\xxx\\xxx\\xxx\\test1.txt");  
		  
		    FileReader in = new FileReader(inputFile);  
		    FileWriter out = new FileWriter(outputFile);  
		    int c;  
		    out.flush();  
		    while ((c = in.read()) != -1)  
		      out.write(c);  
  
		    in.close();  
		    out.close();  
		    System.out.println("Kopiert!");  
  
	}  
	catch (IOException ex) {  
		ex.printStackTrace();  
	    System.out.println("Kopieren fehlgeschlagen!");  
	}  
}