On Mar 19, 2013, at 07:29, vins wrote: > I have server: http://blah.com. The server is just the repository of files. > Client has to fetch the files from http://blah.com/scripts folder. It's > simple http GET. > Every time I don't want to download the files. If the folder has new files I > should download only those. > So for that, I should know the file names. > I will do fs.readDir() on local cache by which I get array of filenames. > same way I should be able to do fs.readDir() for http://blah.com/scripts from > client machine. > I compare the 2 arrays and download the files. > But I'm unable to do. It would be great if I get some solution.
Right, you cannot use fs.readDir() to read the directories of a remote server. You can only read the directories on the local computer. If you want a listing of files on a remote server, the remote server is going to have to provide that information to you in some way. For example, you could configure the blah.com server to serve a scripts/index.json route to return the directory listing to you in a JSON array. Consider that serving a directory listing might sometimes be considered a security issue. -- -- 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/groups/opt_out.
