// Open a log file var myLog = new File("/data/logs/today.log"); var mySummary = new File("/data/logs/summary.log"); myLog.open("r"); mySummary.open("w"); // See if the file exists if(myLog.exists()){ mySummary.write('The file exists'); }else{ mySummary.write('The file does not exist'); } // Write the data in the buffer to the file mySummary.flush(); // Close the file myLog.close(); mySummary.close();