Thursday, May 31, 2001 07:34 PM
It sounds like you know how to run commands using
System.exec(), but you are finding that some commands
do not work, right?
As Ivo said, you probably have a permissions problem.
Unix and Linux have a permissions structure that prevents
users from interfering with other users and the system,
and reserves certain operations (such as creating
new users) to system administrators.
If users are logged into the Linux system and running
your programs, the programs will have the same rights
the users have: they can manage their own files and
directories, but not those of other users.
If, on the other hand, the Java code is running
as a remote service - for example, as servlets - then
it has whatever permissions are assigned to whomever
is running the server process. Please see href="http://www.jguru.com/faq/view.jsp?EID=428051">this
FAQ entry for a discussion of the problems of
user privileges in remote services.