خرید بک لینک

Vote count: 0

As an exercise, I'm trying to use a systemcall from node.js to write a small text file to the /tmp directory. Here is my code:

#!/bin/node
var child_process = require("child_process");
var send = "Hello, world!";
child_process.exec('cat - > /tmp/test1', { input: send });

The file actually gets created; but, no content is placed in it. Things just hang. Can someone please tell me what I'm missing?

Also, I'd really like to know how to do this synchronously.

Thanks for any input.

 ... doug 

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 20 ارديبهشت 1395 ساعت: 6:58

صفحه بندی