aspose 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
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: 40052
    
  28
And welcome to the Ranch
Lukasek Jezek
Greenhorn

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

Welcome, Welcome ;)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need to get/read executable permission from existing file in Java 1.5 (not grater)