public
Created

  • Download Gist
Kopy
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
import java.io.*;
import java.util.*;
public class Kopy
{
public static void die(String str)
{
System.err.println(str);
System.exit(1);
}
public static void main(String args []) throws FileNotFoundException
{
String path = "home/tyteeye510/workspace/Kopy/src";
String path2 = "home/tyteeye510/workspace/Kopy/src"
File f = new File ( args [0]);
if (!f.exists()) die ("does not exist");
if (!f.canRead()) die ("can not read");
if (!f.isFile()) die ( "not a file");
Scanner sc = new Scanner(f);
String text;
PrintWriter pw = new PrintWriter(args [1]);
while(sc.hasNext())
{
text = sc.nextLine();
pw.println(text);
}
pw.close();
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.