Delete of locked file fails, but winscp errorlevel is zero
Bug description:
If source file at SFTP-server is locked (for example opened with MS-Word), and winscp-client tries to delete it, either with 'rm' command or with '-delete' option in 'get' command in a script, winscp.com does not show errormessage and does not increase errorlevel.
Version: winscp.com portable v. 3.0.0.127
Version of MS-Win: Windows 2003 Server R2 SP1
Server and protocol:
SFTP Server: CopSSH 1.4.5.2
Session protocol = SSH-2
SSH implementation = OpenSSH_5.0
Encryption algorithm = aes
Compression = ZLib
File transfer protocol = SFTP-3
I use scripting.
No error message.
The commandline and 'get -delete' script (sftp_test1.txt) and console output:
The commandline and 'rm' script (sftp_test2.txt) and console output:
If source file at SFTP-server is locked (for example opened with MS-Word), and winscp-client tries to delete it, either with 'rm' command or with '-delete' option in 'get' command in a script, winscp.com does not show errormessage and does not increase errorlevel.
Version: winscp.com portable v. 3.0.0.127
Version of MS-Win: Windows 2003 Server R2 SP1
Server and protocol:
SFTP Server: CopSSH 1.4.5.2
Session protocol = SSH-2
SSH implementation = OpenSSH_5.0
Encryption algorithm = aes
Compression = ZLib
File transfer protocol = SFTP-3
I use scripting.
No error message.
The commandline and 'get -delete' script (sftp_test1.txt) and console output:
C:\mylocalfolder\bin>winscp.com /ini=winscp.ini /script=sftp_test1.txt /log=sftp_test1.xml
option batch on option confirm off option transfer binary open sftp://myaccount@myserver.mydomain.com:22 -privatekey=C:\mylocalfolder\keys\myserver.mydomain.com\myaccount\private_key.ppk -hostkey="ssh-rsa 1024 df:41:c3:32:a3:1c:d0:37:e3:b6:73:00:82:fa:5c:8d" get -delete -preservetime ./testfile*.doc "\\mywinserver.myaddomain.com\myfolder\test\" ls ./testfile*.doc* exit
C:\mylocalfolder\bin>dir>nul
C:\mylocalfolder\bin>winscp.com /ini=winscp.ini /script=sftp_test1.txt /log=sftp_test1.xml
batch on
confirm off
transfer binary
Searching for host...
Connecting to host...
Authenticating...
Using username "myaccount".
Authenticating with public key "rsa-key-20081125".
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] myaccount@myserver.mydomain.com
testfile1.doc | 23 KiB | 113,4 KiB/s | binary | 100%
-rw-r--r-- 1 myaccount None 24064 Jun 23 15:12:30 2011 testfile1.doc
C:\mylocalfolder\bin>Echo %errorlevel%
0
The commandline and 'rm' script (sftp_test2.txt) and console output:
C:\mylocalfolder\bin>winscp.com /ini=winscp.ini /script=sftp_test2.txt /log=sftp_test2.xml
option batch on option confirm off option transfer binary open sftp://myaccount@myserver.mydomain.com:22 -privatekey=C:\mylocalfolder\keys\myserver.mydomain.com\myaccount\private_key.ppk -hostkey="ssh-rsa 1024 df:41:c3:32:a3:1c:d0:37:e3:b6:73:00:82:fa:5c:8d" rm ./testfile*.doc ls ./testfile*.doc* exit
C:\mylocalfolder\bin>Echo %errorlevel%
0
C:\mylocalfolder\bin>winscp.com /ini=winscp.ini /script=sftp_test2.txt /log=sftp_test2.xml
batch on
confirm off
transfer binary
Searching for host...
Connecting to host...
Authenticating...
Using username "myaccount".
Authenticating with public key "rsa-key-20081125".
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] myaccount@myserver.mydomain.com
./testfile1.doc
-rw-r--r-- 1 myaccount None 24064 Jun 23 15:12:30 2011 testfile1.doc
C:\mylocalfolder\bin>Echo %errorlevel%
0