Topic "Bug: "get" silently skips files with same name (-ext) as dir"

Author Message
debacle

Guest


Hi. First post here. Apologies for any info/protocol I've missed; will correct ASAP. Also apologies if this is a known bug; couldn't find mention of it with any searches I thought of.

WinSCP Version 4.3.9 (Build 1817) (OS 6.0.6002 Service Pack 2)

I'm using the following script to transfer two files, one of which has the same name as its containing directory (except for extension):

Code:

get -resume "/mnt/sdd1/debacle/files/FooBar/FooBar.txt" "Y:\MyRoot\FooBar\FooBar.txt"
get -resume "/mnt/sdd1/debacle/files/FooBar/baz.jpg" "Y:\MyRoot\FooBar\baz.jpg"


The second file transfers as expected. The first is silently skipped.

As a workaround, I can rename the first file, e.g. to just Foo.txt, and that does the trick.

As far as I can tell, this happens if and only if the source filename without extension matches its containing directory's name.

Log snippet:
Code:

> 2012-07-31 15:29:53.587 Script: get -resume "/mnt/sdd1/debacle/files/FooBar/FooBar.txt" "Y:\MyRoot\FooBar\FooBar.txt"
. 2012-07-31 15:29:53.589 Listing directory "/mnt/sdd1/debacle/files/FooBar".
> 2012-07-31 15:29:53.590 Type: SSH_FXP_OPENDIR, Size: 80, Number: 523
< 2012-07-31 15:29:53.770 Type: SSH_FXP_HANDLE, Size: 13, Number: 523
> 2012-07-31 15:29:53.772 Type: SSH_FXP_READDIR, Size: 13, Number: 780
< 2012-07-31 15:29:53.954 Type: SSH_FXP_NAME, Size: 747, Number: 780
> 2012-07-31 15:29:53.956 Type: SSH_FXP_READDIR, Size: 13, Number: 1036
< 2012-07-31 15:29:54.137 Type: SSH_FXP_STATUS, Size: 28, Number: 1036
< 2012-07-31 15:29:54.139 Status code: 1
> 2012-07-31 15:29:54.141 Type: SSH_FXP_CLOSE, Size: 13, Number: 1284
> 2012-07-31 15:29:54.143 Script: get -resume "/mnt/sdd1/debacle/files/FooBar/baz.jpg" "Y:\MyRoot\FooBar\baz.jpg"
. 2012-07-31 15:29:54.145 Listing directory "/mnt/sdd1/debacle/files/FooBar".
> 2012-07-31 15:29:54.146 Type: SSH_FXP_OPENDIR, Size: 80, Number: 1547
< 2012-07-31 15:29:54.321 Type: SSH_FXP_STATUS, Size: 24, Number: 1284
. 2012-07-31 15:29:54.323 Discarding reserved response
< 2012-07-31 15:29:54.500 Type: SSH_FXP_HANDLE, Size: 13, Number: 1547
> 2012-07-31 15:29:54.502 Type: SSH_FXP_READDIR, Size: 13, Number: 1804
< 2012-07-31 15:29:54.682 Type: SSH_FXP_NAME, Size: 747, Number: 1804
> 2012-07-31 15:29:54.684 Type: SSH_FXP_READDIR, Size: 13, Number: 2060
< 2012-07-31 15:29:54.865 Type: SSH_FXP_STATUS, Size: 28, Number: 2060
< 2012-07-31 15:29:54.870 Status code: 1
> 2012-07-31 15:29:54.871 Type: SSH_FXP_CLOSE, Size: 13, Number: 2308
. 2012-07-31 15:29:54.873 File: "/mnt/sdd1/debacle/files/FooBar/baz.jpg"
. 2012-07-31 15:29:54.876 Copying "/mnt/sdd1/debacle/files/FooBar/baz.jpg" to local directory started.
. 2012-07-31 15:29:54.878 Binary transfer mode selected.
. 2012-07-31 15:29:54.883 Checking existence of partially transfered file.
. 2012-07-31 15:29:54.890 Opening remote file.
> 2012-07-31 15:29:54.892 Type: SSH_FXP_OPEN, Size: 112, Number: 2563
< 2012-07-31 15:29:55.056 Type: SSH_FXP_STATUS, Size: 24, Number: 2308
. 2012-07-31 15:29:55.058 Discarding reserved response
< 2012-07-31 15:29:55.236 Type: SSH_FXP_HANDLE, Size: 13, Number: 2563
> 2012-07-31 15:29:55.239 Type: SSH_FXP_FSTAT, Size: 13, Number: 2824
> 2012-07-31 15:29:55.241 Type: SSH_FXP_READ, Size: 25, Number: 3077
. 2012-07-31 15:29:55.419 3 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
< 2012-07-31 15:29:55.423 Type: SSH_FXP_ATTRS, Size: 37, Number: 2824
. 2012-07-31 15:29:55.430 Storing reserved response
< 2012-07-31 15:29:56.376 Status code: 1
. 2012-07-31 15:29:56.378 23 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
> 2012-07-31 15:29:56.382 Type: SSH_FXP_CLOSE, Size: 13, Number: 6916
< 2012-07-31 15:29:56.384 Type: SSH_FXP_STATUS, Size: 28, Number: 6149
< 2012-07-31 15:29:56.562 Type: SSH_FXP_STATUS, Size: 28, Number: 6405
< 2012-07-31 15:29:56.751 Type: SSH_FXP_STATUS, Size: 28, Number: 6661
> 2012-07-31 15:29:58.747 Script: exit
. 2012-07-31 15:29:58.749 Script: Exit code: 0
. 2012-07-31 15:29:58.750 Closing connection.
. 2012-07-31 15:29:58.752 Sending special code: 12
. 2012-07-31 15:29:58.754 Sent EOF message
Advertisements
debacle

Guest


I should also mention:
- since I'm not renaming the files (unless they have illegal Windows filename characters), I tried omitting the destination filename - no change
- I'm doing one file at a time on purpose; I have an automated process that runs a concurrent WinSCP instance per file, to maximize my bandwidth usage
- haven't found time to try to compile/debug the source yet
- WinSCP rocks! Smile
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24552
Location: Prague, Czechia
Can you send me an email, so I can send you back a debug version of WinSCP to track the problem? Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.

You will find my address (if you log in) in my forum profile.
_________________
Martin Prikryl
debacle
[View user's profile]

Joined: 2012-08-03
Posts: 2
Thanks, I've sent the email as requested.
debacle
[View user's profile]

Joined: 2012-08-03
Posts: 2
prikryl tracked this down to user error.

The source location for commands like 'get' and 'put' is always a mask: http://winscp.net/eng/docs/file_mask#basic_syntax

In my case I had '[' characters in some of my filenames, so in C# I now do a .Replace( "[", "[[]" )

Don't think there's a flag/option to treat the source location as a literal filename instead of a mask; might be a nice feature to have?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24552
Location: Prague, Czechia
debacle wrote:
In my case I had '[' characters in some of my filenames, so in C# I now do a .Replace( "[", "[[]" )

The next version will include a method for this:
http://winscp.net/tracker/show_bug.cgi?id=901
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License