Created
November 13, 2012 16:27
-
-
Save ElvisLives/4066764 to your computer and use it in GitHub Desktop.
A snippet with a windows dir command for people doing www.nodebeginner.org that aren't using cygwin and are running some form of Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var exec = require("child_process").exec; | |
function start(response) { | |
console.log("Request handler 'start' was called."); | |
// find all Excel files recursively | |
exec("dir C:\\ *.xls /s", | |
{ timeout: 10000, maxBuffer: 20000*1024 }, | |
function (error, stdout, stderr) { | |
response.writeHead(200, {"Content-Type": "text/plain"}); | |
response.write(stdout); | |
response.end(); | |
}); | |
} | |
function upload(response) { | |
console.log("Request handler 'upload' was called."); | |
response.writeHead(200, {"Content-Type": "text/plain"}); | |
response.write("Hello Upload"); | |
response.end(); | |
} | |
exports.start = start; | |
exports.upload = upload; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment