// Set an instance of a File var mySummary = new File("/data/logs/summary.log"); // Open the log file for writing mySummary.open("w"); // Write a string to the file mySummary.write('Hello, World!'); // Flush the buffer to the file mySummary.flush(); // Close the file mySummary.close();