FAQ Database Discussion Community


ImageMagick compare: exit code 1 when spawned from Node.js, but exit code 0 when run from the command line

javascript,node.js,imagemagick,spawn,external-process
$ compare --version Version: ImageMagick 6.9.1-1 Q16 x86_64 2015-04-15 http://www.imagemagick.org Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC License: http://www.imagemagick.org/script/license.php Features: DPC Modules Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png xml zlib $ node --version v0.10.33 I'm writing a Node.js script to automatically process some images for me. When...

How to print a message within a process when it gets the right from another process in erlang?

process,erlang,send,alarm,spawn
I'm all new to erlang, and i got this task: Write a function "setalarm(T,Message)" what starts two processes at the same time. After T miliseconds the first process sends a message to the second process, and that message will be the Message arg. It's forbidden to use function library, only...

How to assert a spawn is “filled”?

unity3d,network-programming,spawn,photon
I have two spawn spots where a player will show up upon connection. I need that, when one of the players connects on one of the spots, any other player will always spawn at the other spot. Here's some visual in case it helps: https://goo.gl/Y0ohZC Thanks in advance, IC...

Spawn random objects without overlapping (Java)?

java,object,overlap,spawn
I'm developing a game in Java, and part of it requires that objects spawn at the top of the screen and proceed to fall down. I have three objects that can possibly spawn, and three possible x coordinates for them to spawn at, all stored in an array called xCoordinate[]....

How to get return value from a forked / spawned process in Ruby?

ruby,process,output,fork,spawn
My simple test program: pid = Process.spawn("sleep 10;date") How can I place the output (eg stdout) of the "date" command in a variable when it is available? I don't want to use a file for the data exchange....

Spawn nodes at random times combing waitForDuration:withRange and runBlock: in an SKAction sequence

swift,sprite-kit,skspritenode,spawn,skaction
I am making a game with SpriteKit where I have nodes spawning at the top of the screen and falling. However, I want these nodes to spawn at a random time interval between 0.1 and 3 seconds. For example, the first node spawns in 1.3 seconds, the next in 1.8,...

Visual Studio Code - Debugging a spawned process

node.js,debugging,spawn,vscode
The project setup, is a basic express application, generated with express-generator. The project, vscode-debugging-node is available at GitHub Please refer the screencast at Visual studio Code - Debugging node application The Gruntfile.js in root of the project, manages the dev process. The purpose of the Gruntfile.js is simple, it starts...

Node spawn process

node.js,http,express,spawn
Unable to find out the issue in following script, what i want to achieve with the script is to have a node log server that would listen to post requests with log title and log details as query parameters, write to a file and then throw back as json on...

Node spawn cant pipe cmd commands

node.js,cmd,spawn
Hello I'm creating a plugin which uses some command line commands in order to get the process memory and cpu usage how ever altho the command works in terminal it does not when running with node. Furthermore when running with node the findstr part doesnt work at all, and because...

nodejs child_process pass cmd args down to script

node.js,child-process,spawn
I use child_process.spawn to create a new process: child_process.spawn('node', ['app.js', 'x']); is there a way for me to get the cmd args(['app.js', 'x']) in app.js?...

Get 'spawn cmd ENOENT' when try to build Cordova application (event.js:85)

node.js,cordova,cmd,spawn
Get this error in windows cmd when I try to build (emulate) Cordova app. D:\dev\Cordova\toDoList>cordova build android Running command: D:\dev\Cordova\toDoList\platforms\android\cordova\build.bat events.js:85 throw er; // Unhandled 'error' event ^ Error: spawn cmd ENOENT at exports._errnoException (util.js:746:11) at Process.ChildProcess._handle.onexit (child_process.js:1046:32) at child_process.js:1137:20 at process._tickCallback (node.js:355:11) ERROR building one of the platforms: Error:...

In nodejs on windows, how do I use the `uid` option with child_process.spawn?

node.js,spawn
What I would like to do is to get the current users uid. I am exec'ing a process elevated and then I want to spawn another process with the original users uid again. How do I get the current users uid on windows? var child = spawn(process, args, { detached:...

erlang processes communication (code error)

process,erlang,spawn
I am new to Erlang. In my code I try to give each of my 2 processes a list of numbers. The process oid should send all even numbers in its list to the process eid, which should send all odd numbers in its process to oid. When a process...

spawn at random position Android

java,android,random,spawn
i have problem with Android. I'm trying make project that i draw circles on random position. After touch on this circle you will get score and circle will disapear. But i have problem that my object is spawn then disapear without touch and spawn i other location. Here is my...

Java Runtime.exec() doesn't honor Linux alias

java,linux,process,alias,spawn
I have a compiled third party java program which uses Runtime.exec() to spawn a process but i wanted to add additional arguments to the process when the process starts using alias, but Java Runtime.exec() doesn't seem to honor. I tried with my own program but still it doesn't see to...

libgdx Temporary sprite movement after being spawaned

java,libgdx,movement,spawn,spawning
public class Player { private Sprite enemy; public Rectangle bounds; private SpriteBatch batch; private float deltaTime; private float timer; private ArrayList<Sprite> enemies; private Iterator<Sprite> enemyIterator; private ArrayList<Vector2> posCoordinate; Sprite newEnemy; public void create(){ batch=new SpriteBatch(); timer=0; enemy=new Sprite(new Texture(Gdx.files.internal("spr_player.png"))); bounds=new Rectangle(200,700,82,80); enemies=new ArrayList<Sprite>(); posCoordinate=new ArrayList<Vector2>();...

How can I pass all current environmental variables in a node spawn?

node.js,environment-variables,parent-child,spawn
I am spawning child tasks in Node the following way: function createChildProc(prog, params0, cmdAndEnv) { var spawn = require('child_process').spawn; return spawn(prog, params0, cmdAndEnv); } Where cmdAndEnv manually contain the environment variables created during the initial fire up of Node. Instead of manually issuing all the environmental variables into the spawned...

How to spawn enemies randomly each level in a game

java,spawn
I am making a relatively simple game in Java in which the objective is to survive different levels of enemies. Every level one to two more enemies are added to the already existing enemies, and every tenth level there is a boss battle. Example: If level one spawns one enemy,...

Handling the child process starting

node.js,process,spawn
I'm using spawn for creating child processes. I want to create a child process and after it is started I want to exit the current process. var Spawn = require("child_process").spawn; var sp = Spawn("sleep", ["10000"]); sp.unref(); process.exit(); The code above works fine: it creates a child process (sleep) which will...