I'm writing Java 6 application and I have to check if a file is readable. However, on Windows canRead()
always returns true
. So I see that probably, the only solution could be some native solution based on WINAPI and written in JNA/JNI.
But, there is another problem, because it's difficult to find a simple function in WINAPI which would return information about access to a file. I found GetNamedSecurityInfo
or GetSecurityInfo
but I'm not an advanced WINAPI programmer and they are too complicated for me in connection with JNA/JNI. Any ideas how to deal with this problem?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…