This is an old revision of the document!
File File Mask/Wildcard
Some Session
class methods manipulating files accept a file mask/wildcard rather than a path. The methods include:
Advertisement
To avoid the methods to interpret the special characters in the path as a mask, use the Session.EscapeFileMask
method to escape the special characters. This is particularly important, when you use variable paths.
For example, if your file is named filewithstar*.txt
, passing such name directly to Session.GetFiles
would download all files with name starting filewithstar
and .txt
extension, not only filewithstar*.txt
. The Session.EscapeFileMask
converts the name to unambiguous mask filewithstar[*].txt
, that matches only the filewithstar*.txt
.