package iotest2;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Date;

/**
 * @author Ralf Kunze (rkunze@uos.de), Institut fuer Informatik, Universitaet
 *         Osnabrueck
 * @date 22.04.2007
 */
public class WriteReadTest {

	public static void main(String[] args) {
		
		File file = new File("iotest2/DATEI.txt");
		
		FileWriter fw = null;
		
		try {
			fw = new FileWriter(file, true);
			fw.write("Dies ist ein Test " + new Date() + "\n");
		} catch (IOException e) {
			System.err.println("Could not write");
			e.printStackTrace();
		} 
		finally {
//			try { fw.flush(); } catch (IOException e) { System.err.println("Could not flush"); }
			try { fw.close(); } catch (IOException e) { System.err.println("Could not close"); }

		}
	}
}
