Expected behavior check

Advertisement

djhurt1
Joined:
Posts:
2

Expected behavior check

I wrote several Windows batch scripts several years ago and I included the line below. I needed to copy all files from a local folder to a remote folder and exclude the sub directory that resided in the local folder. I think that is why I included the below line. It's been awhile since I've done anything in WinSCP so I hoped others could confirm this is the best way to accomplish what I intended to do or if I should change it because the current way I wrote could cause unintentional issues? It's been working all these years but feels kind of hackish but perhaps it's fine as is?
put -filemask=|%macrolocal%\*\ %macrolocal%\*.* %macroremotein%"
 
Where macrolocal is the local directory with a subdirectory inside it. Macroremotein is as you might suspect the remote directory.

Reply with quote

Advertisement

djhurt1
Joined:
Posts:
2

Re: Expected behavior check

Curious how the slashes matter in this context? In my example I used
put -filemask=|%credmgntlocal%\*\ %credmgntlocal%\*.* %mtremotein%
But yours is
put -filemask=|*/ %macrolocal%\*.* %macroremotein%
Using -filemask does the convention not have to follow the target system? Obviously it doesn't but I'm curious about that. Forgive my ignorance :)

Reply with quote

nobugme
Joined:
Posts:
5

Hi,
I’ve used -filemask before, but I’m curious—does the order of the patterns in the mask affect performance or the way files are processed during a transfer? For example, if we exclude multiple subdirectories with |*/dir1/|*/dir2/, is it handled sequentially or all at once?

Thank you.

Reply with quote

Advertisement

nobugme

Hi, using -filemask=|*/ as Martin suggested seems like the best way to skip subfolders. About the order of the mask, I think it doesn’t change much since all patterns are checked together.

Reply with quote

Advertisement

You can post new topics in this forum