You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Jurado, Benjamin - BLS CTR" <Ju...@bls.gov> on 2005/12/16 21:06:36 UTC

Commons-net

Hello

I am trying to set a permissions on a file using the following code:
FTPClient ftp = new FTPClient();
ftp.connect(server);
ftp.login(user,passwd);
ftp.changeWorkingDirectory(dir);

boolean ftpResults = ftp.sendSiteCommand("chmod 0770 " +file); //tried
chmod 770 

ftp.site("chmod 770"); //also failed.
The ftpResults return true. But when I check the permission on the Unix
server the remain the same.

Have also tried 

ftpFiles[i].setPermission(FTPFile.USER_ACCESS,FTPFile.READ_PERMISSION,tr
ue);
ftpFiles[i].setPermission(FTPFile.USER_ACCESS,FTPFile.WRITE_PERMISSION,t
rue);
ftpFiles[i].setPermission(FTPFile.USER_ACCESS,FTPFile.EXECUTE_PERMISSION
,true);

Is there a ftp library that allows this action?
This has also failed....
Thanks
Benjamin Jurado


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org