Spawning process not working

2 views (last 30 days)
karthiksankar
karthiksankar on 22 Dec 2015
Edited: Walter Roberson on 23 Dec 2015
HI I need a help to run windows exe file by passing 2 arguments continuously.I couldn't run spawn.m file i got error is "Attempt to execute SCRIPT spawn as a function:"
Thanks in advance

Answers (1)

Walter Roberson
Walter Roberson on 22 Dec 2015
If you used spawn file contribution then your probably need to recompile the Cc code into a DLL: the DLL that is provided is probably only for Windows 32.
  2 Comments
karthiksankar
karthiksankar on 23 Dec 2015
Edited: karthiksankar on 23 Dec 2015
Thank u Walter Roberson I have windows 8.1 64 bit .Is it possible to compile 64 bit system?
Walter Roberson
Walter Roberson on 23 Dec 2015
Edited: Walter Roberson on 23 Dec 2015
I am not positive, but it looks like if you cd to the directory where the spawn.c code is, and you invoke
mex -v spawn.c
that you will get out an appropriate dll that would probably be named spawn.mexw64
Note: the difference between using spawn() and dos() is that spawn will allow you to access the exit code of what you run. spawn() is not for creating multiple threads, at least not in the form coded (but that could be adapted.) spawn() as coded waits for the process to finish.
spawn() is not at all suitable for the case of creating processes you need to be able to interact with by using standard I/O .

Sign in to comment.

Categories

Find more on Application Deployment in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!