Related Examples
  1. file mkdirs Example
  2. file mkdir Example
  3. file listRoots Example
  4. file listFiles Example
  5. file listFiles Example
  6. file listFIles Example
  7. file list Example
  8. file list Example
  9. file length Example
  10. file lastModified Example
  11. file isHidden Example
  12. file isFile Example
  13. file isDirectory Example
  14. file isAbsolute Example
  15. file hashCode Example
  16. file getPath Example
  17. file getParentFile Example
  18. file getParent Example
  19. file getName Example
  20. file exists Example
  21. file equals Example
  22. file deleteOnExit Example
  23. file delete() Example
  24. file createTempFile2 Example
  25. file createTempFile1 Example
  26. file createNewFile Example
  27. file canWrite Example
  28. file canRead Example
  29. file canExecute Example
  30. File ToURL() Example
  31. File toURI() Example
  32. File ToString() Example
  33. File SetWritable1() Example
  34. File SetWritable() Example
  35. File SetReadOnly() Example
  36. File SetReadable1() Example
  37. File SetReadable() Example
  38. File SetLastModified() Example
  39. File SetExecutable1() Example
  40. File SetExecutable()() Example
  41. File RenameTo() Example
  42. File Mkdirs() Example
  43. File Mkdir() Example
  44. File List() Example
  45. File Length() Example
  46. File LastModified() Example
  47. File IsHidden() Example
  48. File IsFile() Example
  49. File IsDirectory() Example
  50. File IsAbsolute() Example
  51. File HashCode() Example
  52. File GetUsableSpace() Example
  53. File GetTotalSpace() Example
  54. File GetPath() Example
  55. File GetParentFile() Example
  56. File GetParent() Example
  57. File GetName() Example
  58. File GetFreeSpace() Example
  59. File GetCanonicalPath() Example
  60. File GetCanonicalFile() Example
  61. File getAbsolutePath Example
  62. File class getAbsoluteFile()method example
  63. File class exists() method example
  64. File class equals(Object obj)method example
  65. File class deleteOnExit()method example
  66. File class delete()method example
  67. File class createTempFile(String prefix, String suffix, File directory) method example
  68. File class createTempFile(String prefix, String suffix)method example
  69. File class createNewFile()method example
  70. File class compareTo(File pathname)method example
  71. File class canWrite()method example
  72. File class canRead()method example
  73. File class canExecute()method example
  74. Java Class File, Java File Methods, Java File Functions,File Examples Java

View All Examples

File SetExecutable()() Example

A convenience method to set the owner's execute permission for this abstract pathname.

File class SetExecutable()() method example. This example shows you how to use SetExecutable() method.This method  is a convenience method to set the owner's execute permission for this abstract pathname.

Here is the code:-

 * @Program that set the owner's execute permission for this abstract pathname. 
 * Author:-RoseIndia Team
 * Date:-30-May-2008

public class SetExecutable {

    public static void main(String[] args) {
        File f = new File("/home/girish/Desktop/girish.txt");
        if (f.exists()) {
            boolean b = f.setExecutable(true);
            System.out.println("set the owner's read permission: "+b);
        else {
            System.out.println("File cannot exists: ");


Output of the Program
 set the owner's read permission: true

Post Comment
Contact no :
  Refresh Image
Verify Image:
Your Comment's