Documentation flaw introduced before 9.0 and persisting through V11.0.0
In the documentation for Get
it says:
If the file found by
<<name
is a directory, the Wolfram Language will try to load the file init.m in that directory.
So I make a folder called test
with a single file called init.m
whose only contents are
Print["It works."]
In the same directory as the folder test
I open a notebook and run
SetDirectory[NotebookDirectory[]];
<<test
which returns Get::noopen: Cannot open test
. (Note that <<test/init.m
works as expected).
What gives?
Edit: This has been filed as a documentation bug to Wolfram.
Get["test", Path -> {NotebookDirectory[]}]
does not work. I think it should? $\endgroup$