This content has been marked as final. Show 5 replies
In Linux a user has to have read permission on a file to even see that it exists. As a result, if a user (or a group to which they belong) doesn't have read access to the file File.exists() will return false. Windows which doesn't have as tightly controlled access to files will admit that a file exists whether it can be read or not.
This is proof that I should never answer a question off the top of my head when I haven't had my red bull yet. This is wrong. You will be able to see it if you have read and execute on the directory.
thumps self in head
Message was edited by:
File.canWrite() ?I mean of course
Hi Thanks for replies,
Let there are 2 users root, system in Linux and system as effective user and JRE is running under system user.
When ever checking for file permissions it is returning results with respect to effective user i.e. system user.
Is there any way to check whether a file have permissions for root user?
Is there any way to change effective user of Linux using java ?
Did you able to resolve this issue, if please let me know how you did that