This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread 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 Android Security Essentials Live Lessons this week in the Android 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.
 
Don't get me started about those stupid light bulbs.
 
subject: How can I examine or change file permissions using Java?
 
Similar Threads
delete content of file from java
Where can i see the java file of a container converted JSP file in weblogic
Sorting XML nodes?
How to Delete a Directory
Connecting to Unix via Windows