Issue with filenames with WinSCP commandline

Advertisement

bobbygsk
Joined:
Posts:
4

Issue with filenames with WinSCP commandline

Hi,

I have batch script that calls WinSCP. I successfully implemented "put" script for other processes
I'm trying to get some files for other processes using mget
from
Linux <servername> 2.6.18-422.el5 #1 SMP <timestamp> x86_64 x86_64 x86_64 GNU/Linux
to
Windows 7

The following are the filenames
Orders_0024_20171103.csv_11-03-2017_20:01:05
Instruments_20171004.csv_11-03-2017_20:01:06

Somehow the filenames are read in html format.
Orders_0024_20171103.csv_11-03-2017_20%3A01%3A05
Instruments_20171004.csv_11-03-2017_20%3A01%3A06

The following is the part of the log where I encountered error
. 2017-11-07 13:15:03.471 File: '/archive/mget_temp/Orders_0024_20171103.csv_11-03-2017_20:01:05' [2017-11-07T18:15:03.000Z] [1090153]
. 2017-11-07 13:15:03.471 Copying "/archive/mget_temp/Orders_0024_20171103.csv_11-03-2017_20:01:05" to local directory started.
. 2017-11-07 13:15:03.472 Binary transfer mode selected.
. 2017-11-07 13:15:03.756 Opening remote file.
> 2017-11-07 13:15:03.758 Type: SSH_FXP_OPEN, Size: 93, Number: 6915
< 2017-11-07 13:15:03.759 Type: SSH_FXP_STATUS, Size: 21, Number: 6660
. 2017-11-07 13:15:03.759 Discarding reserved response
< 2017-11-07 13:15:03.760 Type: SSH_FXP_HANDLE, Size: 17, Number: 6915
> 2017-11-07 13:15:03.760 Type: SSH_FXP_FSTAT, Size: 17, Number: 7176
< 2017-11-07 13:15:03.762 Type: SSH_FXP_ATTRS, Size: 37, Number: 7176
* 2017-11-07 13:15:04.545 (EOSError) System Error. Code: 222.

* 2017-11-07 13:15:04.546 The file type being saved or retrieved has been blocked
. 2017-11-07 13:15:04.546 Asking user:
. 2017-11-07 13:15:04.547 Can't create file 'X:\Orders_0024_20171103.csv_11-03-2017_20%3A01%3A05'. ("System Error. Code: 222.

. 2017-11-07 13:15:04.547 The file type being saved or retrieved has been blocked")
< 2017-11-07 13:15:04.548 Script: Can't create file 'X:\Orders_0024_20171103.csv_11-03-2017_20%3A01%3A05'.
< 2017-11-07 13:15:04.549 Script: System Error. Code: 222.

< 2017-11-07 13:15:04.549 The file type being saved or retrieved has been blocked
> 2017-11-07 13:15:04.550 Type: SSH_FXP_CLOSE, Size: 17, Number: 7428
* 2017-11-07 13:15:04.551 (EScpSkipFile) Can't create file 'X:\Orders_0024_20171103.csv_11-03-2017_20%3A01%3A05'.
* 2017-11-07 13:15:04.551 System Error. Code: 222.
* 2017-11-07 13:15:04.552 The file type being saved or retrieved has been blocked
. 2017-11-07 13:15:04.552 File: '/archive/mget_temp/Instruments_20171004.csv_11-03-2017_20:01:06' [2017-11-07T18:15:03.000Z] [4775132]
. 2017-11-07 13:15:04.553 Copying "/archive/mget_temp/Instruments_20171004.csv_11-03-2017_20:01:06" to local directory started.
. 2017-11-07 13:15:04.553 Binary transfer mode selected.
. 2017-11-07 13:15:05.493 Opening remote file.
> 2017-11-07 13:15:05.494 Type: SSH_FXP_OPEN, Size: 93, Number: 7683
< 2017-11-07 13:15:05.495 Type: SSH_FXP_STATUS, Size: 21, Number: 7428
. 2017-11-07 13:15:05.495 Discarding reserved response
< 2017-11-07 13:15:05.496 Type: SSH_FXP_HANDLE, Size: 17, Number: 7683
> 2017-11-07 13:15:05.496 Type: SSH_FXP_FSTAT, Size: 17, Number: 7944
< 2017-11-07 13:15:05.498 Type: SSH_FXP_ATTRS, Size: 37, Number: 7944
* 2017-11-07 13:15:06.135 (EOSError) System Error. Code: 222.

* 2017-11-07 13:15:06.136 The file type being saved or retrieved has been blocked
. 2017-11-07 13:15:06.136 Asking user:
. 2017-11-07 13:15:06.136 Can't create file 'X:\Instruments_20171004.csv_11-03-2017_20%3A01%3A06'. ("System Error. Code: 222.

. 2017-11-07 13:15:06.136 The file type being saved or retrieved has been blocked")
< 2017-11-07 13:15:06.137 Script: Can't create file 'X:\Instruments_20171004.csv_11-03-2017_20%3A01%3A06'.
< 2017-11-07 13:15:06.137 Script: System Error. Code: 222.

< 2017-11-07 13:15:06.138 The file type being saved or retrieved has been blocked
> 2017-11-07 13:15:06.138 Type: SSH_FXP_CLOSE, Size: 17, Number: 8196
* 2017-11-07 13:15:06.139 (EScpSkipFile) Can't create file 'X:\Instruments_20171004.csv_11-03-2017_20%3A01%3A06'.
* 2017-11-07 13:15:06.139 System Error. Code: 222.
* 2017-11-07 13:15:06.139 The file type being saved or retrieved has been blocked
> 2017-11-07 13:15:06.140 Script: ! rm -fR /archive/mget_temp
. 2017-11-07 13:15:06.141 Executing user defined command on command session.
> 2017-11-07 13:15:06.141 [Shell] rm -fR /archive/mget_temp ; echo "WinSCP: this is end-of-file:$?"
< 2017-11-07 13:15:06.144 [Shell] WinSCP: this is end-of-file:0
> 2017-11-07 13:15:06.144 [Shell] pwd ; echo "WinSCP: this is end-of-file:$?"
< 2017-11-07 13:15:06.146 [Shell]
< 2017-11-07 13:15:06.147 [Shell] WinSCP: this is end-of-file:0
. 2017-11-07 13:15:06.147 Changing directory to "".
. 2017-11-07 13:15:06.148 Getting real path for ''
> 2017-11-07 13:15:06.149 Type: SSH_FXP_REALPATH, Size: 22, Number: 8464
< 2017-11-07 13:15:06.149 Type: SSH_FXP_STATUS, Size: 21, Number: 8196
. 2017-11-07 13:15:06.149 Discarding reserved response
< 2017-11-07 13:15:06.151 Type: SSH_FXP_NAME, Size: 75, Number: 8464
. 2017-11-07 13:15:06.151 Real path is ''
. 2017-11-07 13:15:06.151 Trying to open directory "".
> 2017-11-07 13:15:06.152 Type: SSH_FXP_LSTAT, Size: 22, Number: 8711
< 2017-11-07 13:15:06.153 Type: SSH_FXP_ATTRS, Size: 37, Number: 8711
. 2017-11-07 13:15:06.154 Getting current directory name.
. 2017-11-07 13:15:06.154 Getting current directory name.
> 2017-11-07 13:15:06.159 Script: close
. 2017-11-07 13:15:06.159 Closing connection.
. 2017-11-07 13:15:06.159 Sending special code: 12
. 2017-11-07 13:15:06.160 Sent EOF message
. 2017-11-07 13:15:06.160 [Shell] Closing connection.
. 2017-11-07 13:15:06.161 [Shell] Sending special code: 12
. 2017-11-07 13:15:06.162 [Shell] Sent EOF message

Appreciate your help

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Issue with filenames with WinSCP commandline

Comma is not allowed in Windows file names. So WinSCP automatically converts the commas to %3A (it's not any "HTML format" though).

This does not explain the problem you are getting though. It's probably not even related to this. Are you able to download any files to that drive?

Reply with quote

bobbygsk
Joined:
Posts:
4

Re: Issue with filenames with WinSCP commandline

martin wrote:

Comma is not allowed in Windows file names. So WinSCP automatically converts the commas to %3A (it's not any "HTML format" though).

This does not explain the problem you are getting though. It's probably not even related to this. Are you able to download any files to that drive?

":" is converted as "%3A" in log file but the files are not downloaded to the drive.

Reply with quote

martin
Site Admin
martin avatar

Re: Issue with filenames with WinSCP commandline

I was asking "Are you able to download any files to that drive?", not files with comma.

Reply with quote

bobbygsk
Joined:
Posts:
4

Re: Issue with filenames with WinSCP commandline

martin wrote:

I was asking "Are you able to download any files to that drive?", not files with comma.

Yes, I could able to download any other files.
I renamed the file with combination of ls and sed command.
So replaced the string ":" with "-" in the filename.


However, Is there any difference between sftp script "call" and "!".
I encountered error using "ls with sed" when using "!"

If not, then may be I might have done some syntactical error.
When replacing "!" with "call", my code works fine now.

Thanks for your time

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: Issue with filenames with WinSCP commandline

There should not be any difference between ! and call. Can you show us an example?

Reply with quote

Advertisement

You can post new topics in this forum