That's not a directory. That's just a web server serving up HTML. For that you want a HTTP request and a HTML parser like Cheerio.
On Tue, Apr 8, 2014 at 12:09 PM, Jonathan Grenier <[email protected]>wrote: > How do I use fs.readdir to read an online directory ? What do I need to > put in path if I want to read a directory on a specific server ? > if I send a string of a path that lead like my hard disk like > "c:\\snes\\" it works fine. What am I doing wrong for the online one ? > Here is the non-working code: > > var fs = require('fs'); > var path = process.argv[2]; > var fileNameArray = []; // new Array does not work with nodejs > fs.readdir("http://www.atomedge.org/js/", function(err,list) { > for (i = 0; i < list.length; i++) { > if( list[i] != "" ) > { > console.log(list[i]); > } > }; > > }); > > -- > -- > 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 [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- -- 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
