From adc5b447b390946a78e6d0c53419f80e244c1704 Mon Sep 17 00:00:00 2001 From: Forbes Lindesay Date: Thu, 19 Apr 2012 04:35:15 +0200 Subject: [PATCH] Allow user to provide a virtual file system, todo: convert to use stat rather than statSync --- ftpd.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ftpd.js b/ftpd.js index 4c63876..5e3b2e6 100755 --- a/ftpd.js +++ b/ftpd.js @@ -36,7 +36,10 @@ function fixPath(fs, path) { } // host should be an IP address, and sandbox a path without trailing slash for now -function createServer(host, sandbox) { +function createServer(host, sandbox, virtualFS) { + if(virtualFS){ + fs = virtualFS; + } // make sure host is an IP address, otherwise DATA connections will likely break var server = net.createServer(); server.baseSandbox = sandbox; // path which we're starting relative to