aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/doc
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-09-14 12:52:02 +0200
committerBjörn Gustavsson <[email protected]>2017-10-04 11:37:43 +0200
commit36dc96339e2b2b692e6dfe6de43db3a2348732bd (patch)
treeef62a03b52cc627de29fb5ad7250984c0a8a41f9 /lib/stdlib/doc
parent49d0857634fc1a990ab97a144787288570fa2507 (diff)
downloadotp-36dc96339e2b2b692e6dfe6de43db3a2348732bd.tar.gz
otp-36dc96339e2b2b692e6dfe6de43db3a2348732bd.tar.bz2
otp-36dc96339e2b2b692e6dfe6de43db3a2348732bd.zip
Implement escaping of special characters in wildcards
Allow characters with special meaning to be escaped using \ (which must be writen as \\ in a string). That allows matching of filenames containing characters that are special in wildcards. This is an incompatible change, but note that the use of backslashes in wildcards would already work differently on Windows and Unix. Take for example this call: filelib:wildcard("a\\b") On Windows, filelib:wildcard/1 would look for a directory named "a", and a file or directory named "b" inside it. On Unix, filelib:wildcard/1 would look for a file named "a\\b". With this commit applied, filelib:wildcard/1 will look for a file named "ab" on both Windows and Unix. https://bugs.erlang.org/browse/ERL-451
Diffstat (limited to 'lib/stdlib/doc')
-rw-r--r--lib/stdlib/doc/src/filelib.xml5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/stdlib/doc/src/filelib.xml b/lib/stdlib/doc/src/filelib.xml
index 57c4348745..1b69e84d31 100644
--- a/lib/stdlib/doc/src/filelib.xml
+++ b/lib/stdlib/doc/src/filelib.xml
@@ -217,6 +217,11 @@
<p>Other characters represent themselves. Only filenames that
have exactly the same character in the same position match.
Matching is case-sensitive, for example, "a" does not match "A".</p>
+ <p>Directory separators must always be written as <c>/</c>, even on
+ Windows.</p>
+ <p>A character preceded by <c>\</c> loses its special meaning. Note
+ that <c>\</c> must be written as <c>\\</c> in a string literal.
+ For example, "\\?*" will match any filename starting with <c>?</c>.</p>
<p>Notice that multiple "*" characters are allowed
(as in Unix wildcards, but opposed to Windows/DOS wildcards).</p>
<p><em>Examples:</em></p>