Topic "put -delete \\myshare\fullpath1\*[.]* /fullpath2/"

Author Message
usa
[View user's profile]

Joined: 2013-09-11
Posts: 8
In a local directory named "\\myshare\fullpath1\", I've got:
1) A regular file named "test.txt".
2) A subridectory named "subdirectory".

put -delete \\myshare\fullpath1\*[.]* /fullpath2/
uploads nothing, but should upload "test.txt" only.

put -delete \\myshare\fullpath1\*.* /fullpath2/
uploads both the file and the directory, and this is the expected behaviour.

So, how do I upload files only?
It's OK to upload only files with extensions.

PS:
Windows 7 x64
WinSCP, Version 5.5.6 (Build 4746)
Runs from 64-bit cscript.exe, VBScript.
Advertisements
usa
[View user's profile]

Joined: 2013-09-11
Posts: 8
PS: The latest Version 5.7 (Build 5125) has this issue too.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
usa wrote:
put -delete \\myshare\fullpath1\*[.]* /fullpath2/
uploads nothing, but should upload "test.txt" only.

I've never realized it could be used like that Smile
OK, added to the tracker:
https://winscp.net/tracker/show_bug.cgi?id=1283

Quote:
So, how do I upload files only?

See https://winscp.net/eng/docs/faq_script_non_recursive
usa
[View user's profile]

Joined: 2013-09-11
Posts: 8
I am glad to surprise you Smile

Do you mean that in order to transfer all the files without directories I should transfer their parent directory non-recursively?
usa
[View user's profile]

Joined: 2013-09-11
Posts: 8
Nevermind. I've just understood what you mean.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
I actually got completely confused. The dot has a special function in operation masks only, not in file masks and moreover this is a local file mask, which does not even support the set-syntax []. So WinSCP behaves as designed.

I have updated respective comment in put command documentation:
Quote:
The Windows wildcard supports * and ? only. If you want to use a full syntax of file masks, use a -filemask switch.

https://winscp.net/eng/docs/scriptcommand_put#fn1
usa
[View user's profile]

Joined: 2013-09-11
Posts: 8
Thanks!
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