Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to check whether a file got read permissions for perticular user

807605May 25 2007 — edited Jun 13 2007
Problem: Let JRE is running with some x as effective user in LINUX then while checking file permission it is checking permission on that file for that x user.

File f = new File(�file name�)
if(f.exists())
{
System.out.println(�exists�);
}
Else
{
System.out.println(�does not exists�);
}
The above code prints exists only when x user have permissions on that file

Requirement: I would like to check whether a file got read permissions for particular user i.e. whether y user got permissions on that file.

Any help is appreciated
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 11 2007
Added on May 25 2007
5 comments
153 views