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 Beginning Java and the fly likes Using java to chmod files in Unix 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 » Beginning Java
Bookmark "Using java to chmod files in Unix" Watch "Using java to chmod files in Unix" New topic
Author

Using java to chmod files in Unix

Anupreet Arora
Ranch Hand

Joined: Jun 17, 2003
Posts: 81
Can we use java to reliable change permissions (chmod) or owner (chown) of files in a unix file system ?

Any ideas will be most appreciated

Thanks
Anupreet
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Sure. Use the Runtime.exec() family of methods to execute the chmod/chown programs.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using java to chmod files in Unix
 
Similar Threads
Changing File Permission
File.canWrite()?
.bin files????
How to get File.canRead() to return false?
Problem starting Tomcat 4.1.31 on Mac OS X