0
$\begingroup$

In the folder $BaseDirectory\\Kernel I have a file init.m, who calls a customized initialization package

Needs["UserInitialization`","C:\\UserInitialization\\UserInitialization.m"];

Having observed strange behaviours of PutAppend (placed in the package), ransacking in MSE, an hour ago, I have learned of the unusual parsing of the infix form of PutAppend, and for a while I have been supposing that what follows could be ascribed to some non standard parsing of Import. But now the occurrence seems less credible.

In UserInitialization.m

testFile = FileNameJoin[{$UserInitializationFolder ,"aFile.txt"}];
testContent = Import[testFile, "Text"];

provokes an error:

inkOpen::linke: Could not find MathLink executable. >>

Similarly occurs for

testFile = FileNameJoin[{$UserInitializationFolder ,"aFile.txt"}];
testContent = Import[testFile];

but

testFile = FileNameJoin[{$UserInitializationFolder ,"aFile.txt"}];
testContent = Import[testFile, "Lines"];

returns what it is supposed to do:

{"a content"}

Addendum

A resembling question was asked here: "LinkOpen::linke : specified file is not a mathlink executable" but, provided that I'm not misunderstanding, this situation differs in that the code fails even run in interactive mode.

See also Why can't I import a file in the init.m file?, where useful workarounds are proposed.

I would say that my question has been essentually answered there.

$\endgroup$
  • $\begingroup$ Which OS and Mathematica version are you using and how your $UserInitializationFolder is defined? With version 10.4.1 on Win7 x64 I have no problems with the code Import[FileNameJoin[{$UserBaseDirectory, "Kernel", "init.m"}], "Text"]. $\endgroup$ – Alexey Popkov May 1 '16 at 6:11
  • $\begingroup$ @Alexey Pokov Hallo! Mathematica version: 8.0.1.0 OS: Win Xp ver. 5.1.2600 $\endgroup$ – mitochondrial May 3 '16 at 20:53

Browse other questions tagged or ask your own question.