Checks whether a file or directory has executable permission or not.
Checks whether a file or directory has executable permission or not.
The canExecute method of File class can be used for finding out whether the given file has executable permission or not.
import java.io.File;
/**
* File class examples.
*
*/
public class FileExample {
public static void main(String[] args){
// Create file object representing the source file/directory
File file = new File("d:\\temp");
// Check whether the file has executable permission or not.
boolean value = file.canExecute();
System.out.println("File executable permission status : "+value);
}
}
Tags: File, file class examples, File examples, java.io, java.io.File
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply