Here you can find the source of touch(String _filename)
Parameter | Description |
---|---|
_filename | a parameter |
synchronized public static void touch(String _filename)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class Main { /**/* www . j a v a2 s. co m*/ * Erstellt eine neue Datei * * @param _filename */ synchronized public static void touch(String _filename) { File file = new File(_filename); if (true)// if (f.canWrite()) { try { FileOutputStream ofs = new FileOutputStream(file); try { ofs.write('!'); } catch (IOException e) { e.printStackTrace(); } try { ofs.close(); } catch (IOException e) { e.printStackTrace(); } } catch (FileNotFoundException e) { e.printStackTrace(); } } } }