Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I examine or change file permissions using Java?

 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to write in a file which is sometimes read-only, can i make it writable using java?


Thanks
 
Prashant Sehgal
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No using java API.

You can do this:



Call this method with the path of the file.

But even for this to run you need to be the owner of the file.

Regards,
Prashant.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic