File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Need to get/read executable permission from existing file in Java 1.5 (not grater) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Need to get/read executable permission from existing file in Java 1.5 (not grater) " Watch "Need to get/read executable permission from existing file in Java 1.5 (not grater) " New topic
Author

Need to get/read executable permission from existing file in Java 1.5 (not grater)

Lukasek Jezek
Greenhorn

Joined: Jan 19, 2012
Posts: 2
Hi. I want to get/read executable permission (x) from existing file, but I'cant find solution in Java 1.5.
I know, that in Java 1.6 can invoke method of File class: f.canExecute(), but this method is existing since Java 1.6.
Can you help me?
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Then apparently it's not possible with pure Java in 1.5. You'll have to either execute an external command (such as ls in linux) and parse the results or use JNI or JNA to create a native library to examine the file, or find an existing 3rd-party native library that does it.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38062
    
  22
And welcome to the Ranch
Lukasek Jezek
Greenhorn

Joined: Jan 19, 2012
Posts: 2
Ok, thanks for Help!

Welcome, Welcome ;)
 
 
subject: Need to get/read executable permission from existing file in Java 1.5 (not grater)
 
Similar Threads
Problem in RMI based chat server...
Pointbase : How can I create a stored procedures with Pointbase database?
AccesscontrolException
A strange compile error with Maven2
Problem with Sun's Bootstraping Example