Operation Mask

When using some features of WinSCP you may specify operation mask. For example in:


Operation mask can be used to change name of the file being transferred/moved.

The simplest operation mask is new filename. For example when you are uploading file and you type /home/martinp/configuration.txt in target directory/file box, the file will be stored in remote directory /home/martinp under the name configuration.txt, whatever the original filename is.

Such simple operation mask is useful only when transferring/moving one file only. When you are working with set of files you need to use some of the special characters to let each file be stored under different (yet changed, if desired) name. In addition the mask can have two parts, separated by dot (.), which allows you to change base filename and the filename extension separately. The special characters are:

Character Meaning Example
* Keep all remaining characters of part of source filename as is. a*.doc to change the first letter of all files to a and to change extensions of all files to doc.
? Keep the next character of part of source filename as is. *.??~ to replace third letter of file extension with ~.
\ Treat the next character literally (only for changing names of remote files, i.e. for upload). \* to store file under the name *.

All other characters are treated literally, i.e. they will become part of the target filename.

WinSCP by default offers you operation mask *.* that leaves filename as is. Note that you will achieve the same effect with simple * (but not with *. that would trim file extension).

Last modified: by martin