Differences
This shows you the differences between the selected revisions of the page.
2014-11-26 | 2018-01-17 | ||
duplicate "File" (martin) | 5.12.1 session path methods to remotepath class (martin) | ||
Line 5: | Line 5: | ||
* ''[[library_session_removefiles|Session.RemoveFiles]]''. | * ''[[library_session_removefiles|Session.RemoveFiles]]''. | ||
- | To avoid the methods to interpret the special characters in the path as a mask, use the ''[[library_session_escapefilemask|Session.EscapeFileMask]]'' method to escape the special characters. This is particularly important, when you use variable paths. | + | To avoid the methods to interpret the special characters in the path as a mask, use the ''[[library_session_escapefilemask|Session.EscapeFileMask]]'' method (''[[library_remotepath_escapefilemask|RemotePath.EscapeFileMask]]'' method //in the latest beta version//) &beta 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 ''[[library_session_getfiles|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''. | For example, if your file is named ''filewithstar*.txt'', passing such name directly to ''[[library_session_getfiles|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''. | ||
It is an error, when you use path to a file that does not exist with above methods. Though, it is not an error when you use a mask that does not match any file (the directory used with the mask still needs to exist). | It is an error, when you use path to a file that does not exist with above methods. Though, it is not an error when you use a mask that does not match any file (the directory used with the mask still needs to exist). |