Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / phantomjs / lib / phantom / examples / child_process-examples.coffee
1 {spawn, execFile} = require "child_process"
2
3 child = spawn "ls", ["-lF", "/rooot"]
4
5 child.stdout.on "data", (data) ->
6   console.log "spawnSTDOUT:", JSON.stringify data
7
8 child.stderr.on "data", (data) ->
9   console.log "spawnSTDERR:", JSON.stringify data
10
11 child.on "exit", (code) ->
12   console.log "spawnEXIT:", code
13
14 #child.kill "SIGKILL"
15
16 execFile "ls", ["-lF", "/usr"], null, (err, stdout, stderr) ->
17   console.log "execFileSTDOUT:", JSON.stringify stdout
18   console.log "execFileSTDERR:", JSON.stringify stderr
19
20 setTimeout (-> phantom.exit 0), 2000