Filemasks with Spaces

Advertisement

Questioner
Guest

Filemasks with Spaces

Hello,

I am having problems with spaces in my file mask, I have tried these three different ways around it, and none of them get to what I want, which is to exclude the /To Client/ Directory, and download the rest of the files.

Code:
$transferResult = $session.GetFiles($directory.fullname, $full_filepath_to, $False, $transferOptions)

$transferOptions.FileMask = "*.*>200D | */To Client/, */landing_zone/, *.pdf"
$transferOptions.FileMask = ">200D | */To Client/, */landing_zone/, *.pdf"
Both give:
. 2017-02-16 16:00:00.405 file.txt;-;20763893;2017-02-16T20:39:40.000Z;3;"" [0];"" [0];rwxrwxrwx;1
. 2017-02-16 16:00:00.405 Copying 1 files/directories to local directory "C:\landing_zone\"
. 2017-02-16 16:00:00.405 PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask: enrollment_2017022.txt
. 2017-02-16 16:00:00.405 TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; InclM: "*.* | */To Client/, */landing_zone/, *.pdf"; ResumeL: 0
. 2017-02-16 16:00:00.405 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2017-02-16 16:00:00.405 File "/file.txt" excluded from transfer


$transferOptions.Filemask = >200D | */To Client/, */landing_zone/, *.pdf
This allows all files in, and does not mask the /To Client/ directory

Any help on this would be grateful.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Filemasks with Spaces

Your (first and second) syntax seems correct (works for me).

Please attach a full session log file showing the problem (using the latest version of WinSCP).

Reply with quote

Advertisement

You can post new topics in this forum