This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes I/O and Streams and the fly likes How can I examine or change file permissions using Java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How can I examine or change file permissions using Java?" Watch "How can I examine or change file permissions using Java?" New topic
Author

How can I examine or change file permissions using Java?

Prakash Dwivedi
Ranch Hand

Joined: Sep 28, 2002
Posts: 452
I have to write in a file which is sometimes read-only, can i make it writable using java?


Thanks


Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Prashant Sehgal
Ranch Hand

Joined: Jun 20, 2003
Posts: 56
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I examine or change file permissions using Java?