Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can I set a file to Read only n java???  RSS feed

 
Amit Roy
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello
I know that the methods canRead() and canWrite() be used to find the find the read-write properties of a file is there a corresponding method to set the property of a file or may be some other alternative to do the same function . Coz i need to do a file locking system in a particular software.
------------------
Chance Favours the Prepared minds"
 
karl koch
Ranch Hand
Posts: 388
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

there is the setReadOnly() method in the File class.
i think this is what your looking for.
otherwise check the JAVA API for the File class, perhaps you find the thing your looking for.
greetings,
Karl
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!