taoCMS是基于php+sqlite/mysql的国内最小(100Kb左右)的功能完善、开源免费的CMS管理系统

casperjs执行shell与读写文件

2013-10-10
// (…)
var childProcess;
try {
childProcess = require("child_process");
} catch (e) {
this.log(e, "error");
}
if (childProcess) {
childProcess.execFile("/bin/bash", ["mycommand.sh", args1, args2, args3], null, function (err, stdout, stderr) {
this.log("execFileSTDOUT:", JSON.stringify(stdout), 'debug');
this.log("execFileSTDERR:", JSON.stringify(stderr), 'debug');
});
this.log("Done", "debug");
} else {
this.log("Unable to require child process", "warning");
}
地址:https://gist.github.com/clochix/6882184
读写文件:
http://nodejs.org/api/fs.html#fs_fs_write_fd_buffer_offset_length_position_callback

类别:技术文章 | 阅读:412191 | 评论:0 | 标签:casperjs shell

想收藏或者和大家分享这篇好文章→

“casperjs执行shell与读写文件”共有0条留言

发表评论

姓名:

邮箱:

网址:

验证码:

公告

taoCMS发布taoCMS 3.0.2(最后更新21年03月15日),请大家速速升级,欢迎大家试用和提出您宝贵的意见建议。

捐助与联系

☟请使用新浪微博联系我☟

☟在github上follow我☟

标签云