可能要从OS的角度去考虑!这是OS的设置!

解决方案 »

  1.   

    看了看java.io.File类,只能得到文件是否可些,是否隐藏,但是没有找到改文件属性的方法.
      

  2.   

    java好像只能将正常的文件设置为只读属性,但不能将只读文件设置为可写。不过你可以先把原来的文件读出,然后删除掉文件,再建立一个同名的新文件,把原内容和想追加的内容都写进去,再将文件改为只读属性就可以了。
      

  3.   

    java.io.File.setReadOnly(true) can set read-only attribute on a file but cannot clear it. It's a bug, but Sun doesn't want to fix it because of the consideration of possible multi-user of this file. agree with alphafish
      

  4.   

    现在jdk不支持这样作。考虑其它办法吧。