From de0771a4b3d882161f10c1d2d03c8027327f9323 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Thu, 4 Jan 2018 16:54:22 +0100 Subject: 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). --- lib/stdlib/doc/src/filename.xml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'lib/stdlib/doc/src/filename.xml') diff --git a/lib/stdlib/doc/src/filename.xml b/lib/stdlib/doc/src/filename.xml index 14fd5ef787..1135a6dd80 100644 --- a/lib/stdlib/doc/src/filename.xml +++ b/lib/stdlib/doc/src/filename.xml @@ -4,7 +4,7 @@
- 19972017 + 19972018 Ericsson AB. All Rights Reserved. @@ -372,15 +372,18 @@ true tuples {BinSuffix, SourceSuffix} and is interpreted as follows: if the end of the directory name where the object is located matches BinSuffix, then the - source code directory has the same name, but with - BinSuffix replaced by - SourceSuffix. Rules defaults + name created by replacing BinSuffix with + SourceSuffix is expanded by calling + + filelib:wildcard/1. + If a regular file is found among the matches, the function + returns that location together with Options. + Otherwise the next rule is tried, and so on.

+

Rules defaults to:

-[{"", ""}, {"ebin", "src"}, {"ebin", "esrc"}] -

If the source file is found in the resulting directory, the function - returns that location together with Options. - Otherwise the next rule is tried, and so on.

+[{"", ""}, {"ebin", "src"}, {"ebin", "esrc"}, + {"ebin", "src/*"}, {"ebin", "esrc/*"}]

The function returns {SourceFile, Options} if it succeeds. SourceFile is the absolute path to the source -- cgit v1.2.3