Hi i need to change the user/group of certain Files through JAVA. I have seen roughly the same Posix example evrywhere.
public interface POSIX extends Library {
public int chmod(String filename, int mode);
public int chown(String filename, int userId, int groupId);
}
The problems with this is that you have to know the PID and GID, but to do that you will have to pass throught Runtime to get them and so i don't really see the use of chown method. I tried this
public interface POSIX extends Library {
public int chmod(String filename, int mode);
public int chown(String filename, int userId, int groupId);
public int chown(String filename, String user, String group);
}
but the after passing the string parameters for user and group, ls -l shows me 806789808 806789776 dor user/group of the file. So is there a way to pass the user and group as Strings ?