1

Is it possible to retrieve a directory listing of a remote file-system using Node.js. I know how to do it locally using readdir(...) or readdirSync(...) but can I use those methods to return a list of remote files especially from a http or ftp server?

EDIT: I want to do this in webOS so I'm limited to the supported API's it seems. I may have to do some real round-a-bout method like have a script that creates a file that contains a list of files in the folder and just accessing that. So I guess that brings up a second question could I fire a remote script from a local script?

2 Answers 2

2

You may want jsDav and node-ftp.

Sign up to request clarification or add additional context in comments.

Comments

0

Sure. You could find an ftp client for node, then if your server has an ftp server going you can just interact with it.

The following is how you might go about getting real filesystem access to a remote server

If you have root access to the remote machine you are trying to interact with, yes it should be possible. Otherwise, no.

I am not super familiar with all of this, but you will need to do something along the lines of:

  1. Configure a Network File System server (something like this) on your remote machine.
  2. Set up an NFS client on your local machine where node is being run and mount the network file system.
  3. Then i think, you should be able to use the node filesystem library to browse the network file system mounted locally as you would with the normal file system.

1 Comment

Thanks, I'm going to have to play with this. For now I'm just having a daemon running on the server that generates a list of files for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.