Community
Participate
Working Groups
On ssh connection to build.eclipse.org, have folder $HOME/ws2/eclipse, ls -l: drwxr-xr-x 3 moberhuber common 176 2007-02-19 15:54 . drwxr-xr-x 6 moberhuber common 336 2007-02-19 15:49 eclipse lrwxrwxrwx 1 moberhuber common 61 2007-02-19 15:49 publish -> /home/data/httpd/download.eclipse.org/dsdp/tm/downloads/drops In the RSE system view, select symbolic link "publish" and choose delete. An error dialog is shown: "Operation failed. File system input or output error. Message reported from file system: Sftp: 2: No such file"
Created attachment 76964 [details] workaround I think one of the problems with this is that SftpATTRS#isLink() always returns false (maybe also a known bug - never worked with Jsch until now). As deleting a link simply works with the rm command, this should be also used for deleting links to directorys. Attached is a patch which catches the exception mentioned above and tries to delete the resource which could be a link.
The patch and analysis helped fixing the issue, though I finally applied a different fix: calling ChannelSftp.lstat() instead of ChannelSftp.stat() returns the attributes of the link rather than the attributes of the item linked to, so this single-character-fix does the trick as well. There is no bug in Jsch, it was just user error :-) Anyways, since your work helped fixing the issue I added your name to the list of contributors -- thanks for the patch! Next time you submit a patch, you could make our work slightly easier if you could please 1. Add a line in the file header comment for your contribution, such that it is shipped with the patch. This time, I added the following for you: * Benjamin Muskalla (b.muskalla@gmx.net) - [174690][ssh] cannot delete symbolic links on remote systems 2. Add the disclaimer in the bugzilla comment as outlined here: http://www.eclipse.org/dsdp/tm/development/committer_howto.php#external_contrib Thanks!