[nodejs] Re: Page infrequently hangs on loading

2012-04-01 Thread s0urce
I am not sure, i am using 'Content-Length':Buffer.isBuffer(body)? body.length: Buffer.byteLength(body) to send content-length infomation. But maybe i missed any other header infomation. Thats my whole header for static files: 'Content-Type': type, 'Cache-Control': 'public,max-age='+expire_time,

Re: [nodejs] Request to join nodejs group

2012-04-01 Thread Ben Noordhuis
On Sun, Apr 1, 2012 at 12:18, Taybo taieb.charr...@gmail.com wrote: I am a new nodejs developer and having seen nodejs in google groups, I want to join it You just did. Welcome. :-) -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

Re: [nodejs] Opening file for write results in unknown error -1

2012-04-01 Thread Ben Noordhuis
On Sun, Apr 1, 2012 at 02:44, Michael Dillon mikedillo...@gmail.com wrote: Ben this is the second time in one week that you have helped me with this project! Thanks so much! Do you use stackoverflow? I'd like to give you credit for the points if you do. Happy to help, Michael. I'm not on SO

Re: [nodejs] filter log-messages using winston dependant of environment

2012-04-01 Thread framlin
Servus Marak, Am Donnerstag, 29. März 2012 13:44:56 UTC+2 schrieb Marak Squires: I'd recommend using https://github.com/flatiron/flatiron for this. do you have any docu-hints where I can see, how to log requests with flatiron and ecstatic? Tanks in advance Wolfgang -- Job Board:

[nodejs] post json data to mongo db using express and mongoose

2012-04-01 Thread shawn wilson
from everything i've read, this should be pretty easy (and maybe a web browser and jquery would do better than curl). however, i am obviously missing something because i just can't figure this out. my test is: curl -ik -X POST -d 'data={url:http://www.something.com,title:something,note:will

Re: [nodejs] fs.read

2012-04-01 Thread Matthew Hazlett
It already is a string. I just don't get it :-( -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups nodejs group. To post to this group, send email

[nodejs] Re: fs.read

2012-04-01 Thread Roly Fentanes
I don't see a callback on your `writeFile`. are you sure there's no race condition? On Sunday, April 1, 2012 1:25:29 PM UTC-7, Matthew Hazlett wrote: This throws an error unexpected end of file. fs.readFile(__dirname + '/' + filename, function (err, data) { if (err)

Re: [nodejs] fs.read

2012-04-01 Thread Charlie McConnell
did you just leave out the callback to your fs.writeFile, or did you not provide one? If you're using fs.readFile - an asynchronous method - and not providing a callback, that whole thing will be a race condition for you. Either use fs.readFileSync, or provide a callback and don't try to access

Re: [nodejs] fs.read

2012-04-01 Thread Matthew Hazlett
ok, i'll try that.. thanks Charlie McConnell mailto:char...@charlieistheman.com Sunday, April 01, 2012 6:18 PM did you just leave out the callback to your fs.writeFile, or did you not provide one? If you're using fs.readFile - an asynchronous method - and not providing a callback, that

Re: [nodejs] fs.read

2012-04-01 Thread Matt Patenaude
The problem is that you aren't using readFileSync correctly: it returns the result of the read, so instead of: fs.readFileSync(__dirname + '/' + filename, 'ascii', function (err, readData) { … }; … you should do: readData = fs.readFileSync(__dirname + '/' + filename, 'ascii); -Matt

Re: [nodejs] fs.read

2012-04-01 Thread Marak Squires
You need to read the documentation, you are not using fs module correctly. Here is corrected call from example: https://gist.github.com/2279298 On Sun, Apr 1, 2012 at 3:53 PM, Matthew Hazlett hazl...@gmail.com wrote: Unfortunately, that did not solve the problem. I posted my code and its

Re: [nodejs] fs.read

2012-04-01 Thread Matthew Hazlett
Thanks, that works! -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups nodejs group. To post to this group, send email to nodejs@googlegroups.com

[nodejs] Modest proposal to make async optional in Node.js

2012-04-01 Thread Olivier Lalonde
I'm sorry if this has been discussed before, but I couldn't find anything. This a modest proposal to introduce sync APIs in Node.js A lot of people would like to use Javascript for their web backend, but don't want to program in an async style (I believe those reasons have already been

Re: [nodejs] Modest proposal to make async optional in Node.js

2012-04-01 Thread Mark Hahn
every I/O call should be async *unless* no call back is supplied, This would clobber my app. Many times I invoke something without a callback. I know it will happen but not when and I don't care. Logging is a good example. I don't wait around for log write callbacks. You know that you