Differences

This shows you the differences between the selected revisions of the page.

2012-02-29 2012-02-29
only file mask for transfers (martin) directory masks are recursive 2, elaborate on combiging masks and include/exclude masks (martin)
Line 1: Line 1:
-====== Masks ======+====== Uses ======
To use the following features of WinSCP you need to specify a mask (wildcard) to select files (or other things): To use the following features of WinSCP you need to specify a mask (wildcard) to select files (or other things):
  * Text file mask for [[transfer_mode|text mode transfers]].   * Text file mask for [[transfer_mode|text mode transfers]].
Line 8: Line 8:
  * Various [[scripting#commands|script commands]].   * Various [[scripting#commands|script commands]].
-===== Filename Mask =====+===== Masks =====
When specifying the mask you can use following patterns: When specifying the mask you can use following patterns:
Line 22: Line 22:
To escape character with special meaning (''*?['') enclose it into set pattern, e.g. ''filewithstar[*]''. To escape character with special meaning (''*?['') enclose it into set pattern, e.g. ''filewithstar[*]''.
 +
 +===== Combining Masks =====
 +In most contexts (basically everywhere except for [[scripting#commands|script commands]]), you can combine several masks using semicolon ('';'') or comma ('','').
 +
 +For example following mask includes all JPG and GIF images: ''*.jpg; *.gif''.
 +
 +===== Include and Exclude Masks =====
 +Mask can combine include and exclude mask separated by pipe (''|'').
 +
 +For example following mask includes all JPG and GIF images, but excludes those starting with ''2010'': ''*.jpg; *.gif | 2010*''.
 +
 +Both include and exclude part can be empty, denoting that everything is included or nothing is excluded, respectively. When include part is empty, masks starts with pipe straight away. When exclude part is empty, you can omit the trailing pipe.
 +
 +In releases //prior to the next release//, in transfer settings, it was possible to explicitly select whether the file mask is include or exclude mask. When exclude file mask was selected, the order of exclude and include mask was reverted. Mask was starting with exclude mask, optionally followed by pipe and include mask. &future
===== Directory Mask ===== ===== Directory Mask =====
Line 44: Line 58:
===== Path Mask ===== ===== Path Mask =====
-When the mask selects files and it makes sense to select them based on directory, you can extend the mask with a path mask. You should separate the path mask from the filename mask by a slash. For example mask ''/home/martinp/*.txt'' matches all text files within the directory, but not in subdirectories. To match all text files within subtree, use mask ''/home/martinp/*.txt; /home/martinp/*/*.txt''((Simpler, but less precise, form would be ''/home/martinp*/*.txt'')).+When the mask selects files and it makes sense to select them based on directory, you can extend the mask with a path mask. You should separate the path mask from the filename mask by a slash. For example mask ''/home/martinp/*.txt'' matches all text files within the directory and its subdirectories (//in the next release only//&future).
-For a relative path mask it makes no difference whether you use back (''\'') or forward slashes (''/''); the mask will always work for both local and remote paths. For example, the mask ''*/public_html/*.bak'' will match backup files both in ''D:\Documents\public_html'' and ''/home/martinp/public_html''. If you want to match directories only, add a slash at the end of the mask.+In releases prior to the next release the previous mask does not match files in subdirectories. To match all text files within subtree, use mask ''/home/martinp/*.txt; /home/martinp/*/*.txt''((Simpler, but less precise, form would be ''/home/martinp*/*.txt'')). &future 
 + 
 +For a relative path mask it makes no difference whether you use back (''\'') or forward slashes (''/''); the mask will always work for both local and remote paths. For example, the mask ''*/public_html/*.bak'' will match backup files both in ''D:\Documents\public_html\'' and ''/home/martinp/public_html/''.
You can also specify full path to specific file or directory, both local and remote. For example if you want to match only specific ''.csv'' directory, not all, use ''/home/martinp/data/.csv/'' instead of ''.csv/''. You can also specify full path to specific file or directory, both local and remote. For example if you want to match only specific ''.csv'' directory, not all, use ''/home/martinp/data/.csv/'' instead of ''.csv/''.
Line 53: Line 69:
For convenience, a masks ''*.*'' and ''*.'' are exceptions matching any file and any file without an extension, respectively, even if its name does not include any dot. For convenience, a masks ''*.*'' and ''*.'' are exceptions matching any file and any file without an extension, respectively, even if its name does not include any dot.
-===== Combining masks and exclude mask ===== 
-In most contexts (basically everywhere except for [[scripting#commands|script commands]]), you can combine several masks using semicolon ('';'') or comma ('',''). 
- 
-You can add exclude mask by separating it by pipe (''|'') from the include mask. To use exclude mask only, start with pipe straight away. 

Last modified: by martin