aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/doc/src/kernel_app.xml
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2018-01-04 16:54:22 +0100
committerHans Bolinder <[email protected]>2018-01-05 16:37:42 +0100
commitde0771a4b3d882161f10c1d2d03c8027327f9323 (patch)
tree26df8eed7c649978fdb513e5cd818e6592b1bafd /lib/kernel/doc/src/kernel_app.xml
parent31782c3accacafb20bc7efd46004921aea8f9f22 (diff)
downloadotp-de0771a4b3d882161f10c1d2d03c8027327f9323.tar.gz
otp-de0771a4b3d882161f10c1d2d03c8027327f9323.tar.bz2
otp-de0771a4b3d882161f10c1d2d03c8027327f9323.zip
stdlib: Let filelib:find_source() search subdirs
The Design Principles states that an application can have Erlang source files one level below the "src" directory, and now filelib:find_source() by default searches one level below "src". The same applies to "esrc". That directory is only mentioned in filename(3).
Diffstat (limited to 'lib/kernel/doc/src/kernel_app.xml')
-rw-r--r--lib/kernel/doc/src/kernel_app.xml20
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/kernel/doc/src/kernel_app.xml b/lib/kernel/doc/src/kernel_app.xml
index e5ac031539..0762cebc94 100644
--- a/lib/kernel/doc/src/kernel_app.xml
+++ b/lib/kernel/doc/src/kernel_app.xml
@@ -4,7 +4,7 @@
<appref>
<header>
<copyright>
- <year>1996</year><year>2017</year>
+ <year>1996</year><year>2018</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -469,8 +469,12 @@ MaxT = TickTime + TickTime / 4</code>
<item><c>ObjSuffix = string()</c></item>
<item><c>SrcSuffix = string()</c></item>
</list>
- <p>Specifies a list of rules for use by <c>filelib:find_file/2</c> and
- <c>filelib:find_source/2</c>. If this is set to some other value
+ <p>Specifies a list of rules for use by
+ <seealso marker="stdlib:filelib#find_file/2">
+ <c>filelib:find_file/2</c></seealso>
+ <seealso marker="stdlib:filelib#find_source/2">
+ <c>filelib:find_source/2</c></seealso>
+ If this is set to some other value
than the empty list, it replaces the default rules. Rules can be
simple pairs of directory suffixes, such as <c>{"ebin",
"src"}</c>, which are used by <c>filelib:find_file/2</c>, or
@@ -478,6 +482,16 @@ MaxT = TickTime + TickTime / 4</code>
file name extensions, for example <c>[{".beam", ".erl", [{"ebin",
"src"}]}</c>, which are used by <c>filelib:find_source/2</c>. Both
kinds of rules can be mixed in the list.</p>
+ <p>The interpretation of <c>ObjDirSuffix</c> and <c>SrcDirSuffix</c>
+ is as follows: if the end of the directory name where an
+ object is located matches <c>ObjDirSuffix</c>, then the
+ name created by replacing <c>ObjDirSuffix</c> with
+ <c>SrcDirSuffix</c> is expanded by calling
+ <seealso marker="stdlib:filelib#wildcard/1">
+ <c>filelib:wildcard/1</c></seealso>, and the first regular
+ file found among the matches is the source file.
+ </p>
+
</item>
</taglist>
</section>