// Let's just generally synchronize this to be safe. static synchronized void appendToFile(String path, String s) ctex { new File(path).getParentFile().mkdirs(); //print("[Logging to " + path + "]"); Writer writer = new BufferedWriter(new OutputStreamWriter( newFileOutputStream(path, true), "UTF-8")); writer.write(s); writer.close(); } static void appendToFile(File path, String s) { if (path != null) appendToFile(path.getPath(), s); }