# Tag Info

17

Get all the files here: http://JeremyThompson.net/Rocks/Mathematica/MmaWord.zip .Net Mathematica Word Library You will need to use a Microsoft library to open word documents. In a language such as .Net it is very easy; just open Visual Studio, reference the Microsoft.Office.Interop.Word .Net DLL (for Words) and the C:\Program Files\Open XML ...

8

Under most operating systems you can use the 2>&1 handle redirection operator(1),(2): Import["!foo 2>&1", "Text"] "'foo' is not recognized as an internal or external command, operable program or batch file."

7

The command Run will do exactly that. For example, try Run["touch ~/Desktop/blankfile"] If you want to read the results back in, there are a few options, and the choice between them depends on exactly what you want to do. The RunThrough command lets you read the output of a command-line back as a Mathematica expression. For example, try ...

5

The problem is that the stdin stream for each process is being left open and needs to be closed. To demonstrate the issue, we create a single process: $process = StartProcess[$SystemShell]; WriteLine[$process, "echo example line"]; KillProcess[$process]; The call to WriteLine implicitly creates a stream object. Even though the process has been killed, ...

4

We had a bug like this on v. 10: it specifically stopped running new processes after you created 100 of them. This was fixed in version 10.0.1. I recommend testing it there, as version 10.0.1 has a number of improvements with respect to StartProcess. I can't test your example in MacOS right now, so please let me know if this isn't working on v. 10.0.1. ...

2

I faced the same problem but I was told here that it was impossible. So, looking for other alternatives I've found it! It's called CoolProp. Given the source files and a Mathematica link file, you need to build a Mathematica-compatible CoolProp.dll yourself. Get them from GitHub Now, I can use it with ease.

2

I googled ".net change working directory", and this link to Microsoft's .NET docs was the first hit: http://msdn.microsoft.com/en-us/library/system.io.directory.setcurrentdirectory(v=vs.110).aspx. It would suggest the following: LoadNETType["System.IO.Directory"] Directory`SetCurrentDirectory["c:\\foo"] To find out the current working directory: ...

1

On Linux you can add the directory containing this library to LD_LIBRARY_PATH. A semi-automated way to do this from a command prompt is this: MATHLINK=$(dirname$(readlink -f $(which math)))/../SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:\$MATHLINK You can use this merthod of detecting ...

Only top voted, non community-wiki answers of a minimum length are eligible