Why does Mathematica WolframScript get file fail? -


i use mathematica 11 , create project containing 2 files: package file named mypackage.m , other named run.m.the package file contains normal functions not in special mathematica package structure (https://reference.wolfram.com/workbench/index.jsp?topic=/com.wolfram.eclipse.help/html/tasks/applications/packages.html) , other contains code mypackage.m , use functions.

(* package.m *) myfun[x_string] := print[x] ...  (* run.m *) <<"package.m" myfun["hello,world"] 

i put these 2 files 1 directory , ensure $path contains directory path. but, when run wolframscript -file ./run.m -print all, complains $failed. question is: how import file when using wolframscript? seems cannot find destination file in same directory.

i use mathematica 11 , run wolframscript in ubuntu server have installed latest free cdf player.

i encountered no problem running script. also, -print all appears superfluous.

c:\users\chrisd\documents\test>dir  volume in drive c windows7_os  volume serial number 102a-b66b   directory of c:\users\chrisd\documents\test  14/09/2017  15:03    <dir>          . 14/09/2017  15:03    <dir>          .. 14/09/2017  14:59                29 package.m 14/09/2017  14:59                38 run.m                2 file(s)             67 bytes            2 dir(s)  215,590,776,832 bytes free  c:\users\chrisd\documents\test>wolframscript -file run.m -print hello,world  c:\users\chrisd\documents\test>type package.m myfun[x_string] := print[x]  c:\users\chrisd\documents\test>type run.m <<"package.m" myfun["hello,world"];  c:\users\chrisd\documents\test> 

Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -