Message Boards Message Boards

2
|
15126 Views
|
16 Replies
|
7 Total Likes
View groups...
Share
Share this post:

RunProcess issues

Posted 9 years ago

Hi all, I don't know if anyone has experienced that, but when I use RunProcess many times it suddenly stops to work, any process that I ask to run it delivers something like "command not find" error. It just starts to work again if I close Mathematica and launch it again. Do you guys have any idea what's going on? I'm using Mathematica 10.1 and my SO is Ubuntu 14.04.

Cheers, -T.C.

POSTED BY: Tiago Castro
16 Replies

Seems to be 8 years after the original post and the problem resides. The use case is a large loop processing thousands of files. From each file, some parameters, stored as binaries in specific fields that Mathematica cannot read them directly (unfortunately). So, I use a Perl program for that (exiftool). The call to exiftool succeeds for sever tens of times and then it fails, returning nothing (empty string), and this effects the rest of the program. It happens for me with Mathematica on the MAC, Mathematica on PC Linux AND on the WEPC. The response of the EPC is the worst of all, since the response time of calling RunProcess under heavy load is the worst of all. Second worst is the MAC, because it is too fast. A modest 3 years old Linux machine is the best, but still multiple failures happens.

When I insert Pause inside the loop, just before the call to RunProcess it reduces (just reduces, not cancel) the number of failures BUT the performance of the program is reduced accordingly.

Hope WRI have a better workaround for that issue.

Posted 8 years ago

What is the output of FileExistsQ["C:\Windows\system32\netstat.exe"] for your system? I expect it to return true if the file exists.

POSTED BY: Updating Name
In[2]:= FileExistsQ["C:\\windows\\system32\\netstat.exe"]
Out[2]= True

In[3]:= FileExistsQ[FileNameJoin[{"C:", "windows", "system32", "netstat.exe"}]]
Out[3]= True
POSTED BY: Udo Krause

Here it does not

enter image description here

... possibly the problem is the account owner name bärbel (has an umlaut) or something like that.

By the way, the Enviroment works

enter image description here

Thank you for checking it again, Rolf.

POSTED BY: Udo Krause

Works, kind of, for me:

StringReplace[#, "\r\n" -> "\n"] &@
 ("StandardError" /. RunProcess[{"netstat", "-h"}])
POSTED BY: Rolf Mertig

RunProcess is a fun function!

now it stopped working

In[1]:= $Version
Out[1]= "10.3.1 for Microsoft Windows (64-bit) (December 9, 2015)"

In[2]:= RunProcess[{"C:\\windows\\system32\\netstat.exe", "-h"}]
During evaluation of In[2]:= RunProcess::pnfd: Program C:\windows\system32\netstat.exe not found.  Check Environment["PATH"]. >>

Out[2]= $Failed

on windows 10

enter image description here

RunProcess[] does also not work under Windows 10 in Mathematica 10.2.0

POSTED BY: Udo Krause
Posted 9 years ago

Hi all, Can you help me? I need to call a FORTRAN program recursively to my notebook. Do you have any suggestions on how to do that aside RunProcess?

Cheers, -T.C.

POSTED BY: Tiago Castro
 RunProcess[{"ping","-c2","duckduckgo.com"}]

works fine on Linux.

RunProcess is a fun function!

POSTED BY: Rolf Mertig
Posted 9 years ago

It doesn't run forever for me (Windows 7, Mathematica 10.1):

<|"ExitCode" -> 0, "StandardOutput" -> "

  Pinging www.google.com [74.125.239.112] with 32 bytes of data:

  Reply from 74.125.239.112: bytes=32 time=26ms TTL=46

  Reply from 74.125.239.112: bytes=32 time=6ms TTL=46

  Reply from 74.125.239.112: bytes=32 time=4ms TTL=46

  Reply from 74.125.239.112: bytes=32 time=31ms TTL=46



  Ping statistics for 74.125.239.112:

      Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

  Approximate round trip times in milli-seconds:

      Minimum = 4ms, Maximum = 31ms, Average = 16ms

  ", "StandardError" -> ""|>
POSTED BY: Jim Baldwin
Posted 9 years ago

www.google.com is an argument to ping so according to the online documentation you'd need the following:

RunProcess[{"ping", "www.google.com"}]
POSTED BY: Jim Baldwin

Thanks, Jim, this seems to be correct but runs forever with no stop. This is probably because pinging is a continues operation till stopped? Daniel any insights?

POSTED BY: Marina Shchitova

Is RunProcess something like running system commands from terminal on Mac ? If yes - why

RunProcess["ping www.google.com"]

won't run ?

POSTED BY: Marina Shchitova
Posted 9 years ago

Thank you, let's see what they get. If working properly RunProcess is awesome.

POSTED BY: Tiago Castro
Posted 9 years ago

Hello Daniel, thank you for replying. I attached a simple notebook that reproduce the problem. It's even worst than I first said, because now I see that help stops working too.

Cheers, -T.C.

Attachments:
POSTED BY: Tiago Castro

Thank you. I have learned that the issue is under active investigation. I added a note to the bug report about testing with the notebook you sent.

POSTED BY: Daniel Lichtblau

Do you have a specific set of examples that will replicate the problem?

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract