import java.io.*;
import java.util.*;
class files
{
public static void main(String args[]) throws IOException
{
Scanner in=new Scanner(System.in);
String name;
System.out.println("Enter filename");
name=in.nextLine();
File f=new File(name);
System.out.println("Name of the file is:" +f.getName());
System.out.println("path of the file is:" +f.getPath());
System.out.println("parent of the file is:" +f.getParent());
System.out.println("File exists :" +f.exists());
System.out.println("file is a Directory:" +f.isDirectory());
System.out.println("file is a ordinary file:" +f.isFile());
System.out.println("file has read permission:" +f.canRead());
System.out.println("file has write permission:" +f.canWrite());
System.out.println("size of the file is:" +f.length());
}
}
I KRISHNAPRASAD PURSUING MY B.TECH IN C.R.REDDY COLLEGE OF ENGINEERING TRADE COMPUTER SCIENCES AND ENGINEERING. I'M HAPPY TO PRESENT ALL TYPE OF PROGRAMS. I HOPE U UTILISE THIS BLOG AND ENJOY YOUR PROGRAMMING. THESE PROGRAMS ARE BEST COMPILED IN TURBO C++ COMPILERS AND SUN JAVA COMPILERS
Friday, July 23, 2010
FILE STATUS
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment