Created
November 22, 2010 21:11
-
-
Save FLYBYME/710690 to your computer and use it in GitHub Desktop.
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 file = ''; | |
var stream = fs.createReadStream('/home/session/A0FFCFFC63DA8D1040586132C7422CA41C29AA4C.torrent'); | |
//stream.setEncoding('UTF-8'); | |
stream.on('data', function(data){ | |
file += data; | |
}); | |
stream.on('close', function(data){ | |
sys.log('File read length: '.grey + file.length); | |
var stuff = bencode.decode(file.toString()) | |
//console.log(sys.inspect(stuff)); | |
response.writeHead(200) | |
response.write(sys.inspect(stuff, true, 6)); | |
response.end() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment