Alright I'm almost certain there's a better way to do this. But here's what I have so far.
I'm using FileOutputStream to make a log file but when I pass my String to it with a "\n" the new line doesn't appear in the text file.
I was thinking I might need the carriage return character as well. What is the escape character for this?
take a look.
thanks,
Martin I don't suffer from insanity.
I enjoy every minute of it.
I'm using FileOutputStream to make a log file but when I pass my String to it with a "\n" the new line doesn't appear in the text file.
I was thinking I might need the carriage return character as well. What is the escape character for this?
take a look.
Code:
...
AddtoLog("Copying "+ fso.toString() + " to " + fsoNew.toString() + "\n");
...
public static void AddtoLog(String logMessage){
FileOutputStream fos;
byte[] buff = new byte[1048576];
int size;
try{
fos = new FileOutputStream(logFile, true);
buff = logMessage.getBytes();
size = buff.length;
fos.write(buff,0,size);
}
catch(FileNotFoundException fnf){
System.out.println("File not found" + fnf);
return;
}
catch(SecurityException se){
System.out.println("Security Exception" +se);
return;
}
catch(IOException e){
System.out.println("IOException " + e);
}
}
thanks,
Martin I don't suffer from insanity.
I enjoy every minute of it.