 #
 # # Baby FTP Deamon
 #
-net = require("net")
+net  = require "net"
+fs   = require "fs"
+exec = require("child_process").exec
 
 module.exports = class BabyFtpd
   authUser = {}

      @reply 202
    "MKD": ()->
      @reply 202
    "LIST": ()->
      @reply 202
    "SITE": ()->
      @reply 202
    "STAT": ()->

      @reply 257, '"/"'
    
    "NLST": ()->
      fs.readdir ".", (err, files)=>
        @dtpServer.dataQueue = files.join("\n")
        @reply 150
    
    "LIST": ()->
      exec "export LANG=en_US.UTF-8; ls -l", (err, stdout, stderr)=>
        @dtpServer.dataQueue = stdout
        @reply 150
    
    "RETR": ()->
      @dtpServer.dataQueue = "<html></html>"
