Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 23rd, 2006, 9:31 AM   #1
MegaArcon
Programmer
 
MegaArcon's Avatar
 
Join Date: Aug 2005
Posts: 66
Rep Power: 0 MegaArcon is an unknown quantity at this point
calling chmod in java

Hi all,

I was wondering if anybody out there has delt with getting java to change permissions in unix. (i.e. able to call things like chmod and chown)

I found a thrid party module that might to the trick:
http://www.purpletech.com/code/doc/c...l/IOUtils.html

Has anybody used this before? Does anybody know of a better way?

Thanks a lot!
MegaArcon is offline   Reply With Quote
Old Jan 23rd, 2006, 9:02 PM   #2
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 856
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
I found this page by searching Google, it might help.
titaniumdecoy is offline   Reply With Quote
Old Jan 24th, 2006, 9:26 AM   #3
MegaArcon
Programmer
 
MegaArcon's Avatar
 
Join Date: Aug 2005
Posts: 66
Rep Power: 0 MegaArcon is an unknown quantity at this point
Thanks for the find titaniumdecoy!

Process p = Runtime.getRuntime().exec("chmod 444 file.txt");
Process p = Runtime.getRuntime().exec("chown foo:group file.txt");

Does the trick! Let's all do a dance in celebration! :banana:

(Sorry...just had to get him in there)
MegaArcon is offline   Reply With Quote
Old Jan 25th, 2006, 8:52 PM   #4
ReggaetonKing
Sexy Programmer
 
ReggaetonKing's Avatar
 
Join Date: Nov 2005
Location: New Jersey
Posts: 891
Rep Power: 3 ReggaetonKing is on a distinguished road
Send a message via AIM to ReggaetonKing
:banana: :banana: :banana: :banana: :banana: :banana: :banana: :banana: :banana:
YAY!!!
ReggaetonKing is offline   Reply With Quote
Old Jan 25th, 2006, 9:43 PM   #5
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:49 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC