This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes java file.CanExecute always returns true on an AIX machine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "java file.CanExecute always returns true on an AIX machine" Watch "java file.CanExecute always returns true on an AIX machine" New topic
Author

java file.CanExecute always returns true on an AIX machine

Mahita Ande
Greenhorn

Joined: Sep 26, 2012
Posts: 16
Hi,
I have an application which has to check execution permissions for using the scripts. I am using java file.CanExecute method for this. This methods returns correct boolean when I run the app on HP-UX pr Linux machine. However when I run it on AIX machine it always returns True. Please advise how this can be fixed to return the correct boolean on AIX machine too.

Thank you,
Mahita
K. Gil
Ranch Hand

Joined: Apr 29, 2011
Posts: 75

canExecute ()

"Tests whether or not this process is allowed to execute this file. Note that this is a best-effort result; the only way to be certain is to actually attempt the operation."

--

public boolean canExecute() {
1521 SecurityManager security = System.getSecurityManager();
1522 if (security != null) {
1523 security.checkExec(path);
1524 }
1525 return fs.checkAccess(this, FileSystem.ACCESS_EXECUTE);
1526 }
1527

Returns:
true if and only if the abstract pathname exists and the application is allowed to execute the file
Throws:
java.lang.SecurityException If a security manager exists and its java.lang.SecurityManager.checkExec(java.lang.String) method denies execute access to the file

-----

Any "java.lang.SecurityException"s on AIX?


 
 
subject: java file.CanExecute always returns true on an AIX machine
 
Similar Threads
Using Profiling in Java
Create file from AIX(server) machine to windows machine using java.io
Attn. XSLT: Html with namespaces!!!
Abstract Class & Methods
Apache POI and Java Excel Library : getFitToPage()