package FileHandling;
import java.io.File;
public class WritePer {
public static void main(String[] args) {
File f=new File("abhi.txt");
if(f.exists())
{
//sets write permission for the owner only
boolean b=f.setWritable(true);
System.out.println("The owner's read permission: "+b);
}
else
{
System.out.println("File Doesn't exists");
}
}
}
import java.io.File;
public class WritePer {
public static void main(String[] args) {
File f=new File("abhi.txt");
if(f.exists())
{
//sets write permission for the owner only
boolean b=f.setWritable(true);
System.out.println("The owner's read permission: "+b);
}
else
{
System.out.println("File Doesn't exists");
}
}
}
0 comments:
Post a Comment