package LAB2; import java.io.*; public class LAB2 { public LAB2() { } public static void main(String[] args) { int i; char buff[] = new char[256]; LAB2 lAB2 = new LAB2(); lAB2.invokedStandalone = true; for (i=0 ; i<=255 ;i++) { buff[i] = (char)i; } try { Writer out = new FileWriter ("ascii.txt"); out.write(buff,0,255); out.flush(); out.close(); } catch (Exception e){ System.out.println("Error" + e.toString()); } File file = new File("ascii.txt"); if (file.exists()) { System.out.println("File name: "+file.getName()); System.out.println("Path: "+file.getPath()); System.out.println("Abs. Path: "+file.getAbsolutePath()); System.out.println("Writable: "+file.canWrite()); System.out.println("Readable: "+file.canRead()); System.out.println("Length:" + file.length()+ " bytes" ); } else System.out.println("File not Found"); for (;;); } private boolean invokedStandalone = false; }