Class: EM::FTPD::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/pione/patch/em-ftpd-patch.rb

Instance Method Summary collapse

Instance Method Details

#cmd_mdtm(param) ⇒ Object

get the file's mtime



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/pione/patch/em-ftpd-patch.rb', line 6

def cmd_mdtm(param)
  send_unauthorised and return unless logged_in?
  send_param_required and return if param.nil?

  path = build_path(param)

  @driver.mtime(path) do |result|
    if result.kind_of?(Time)
      send_response result.strftime("213 %Y%m%d%H%M%S%L")
    else
      send_response "550 file not available"
    end
  end
end