home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-04-20 | 496 b | 21 lines |
- import java.io.*;
-
- class NewFile {
- public static void main(String[] args) {
- if (args.length != 1) {
- System.out.println("Supply a file name.");
- System.exit(1);
- }
-
- try {
- File f = new File(args[0]);
- if (f.exists())
- System.out.println(args[0] + " already exists.");
- else
- new FileOutputStream(f);
- } catch (IOException io) {
- System.out.println(io.getMessage());
- }
- }
- }
-